From 5031e6fe9471463eac10b3db6ba62b48cdc7ba8f Mon Sep 17 00:00:00 2001 From: "Zhimin YE (Rex)" Date: Thu, 26 May 2016 17:04:19 +0100 Subject: [PATCH] started review for attribute-directives.jade. --- public/docs/ts/latest/guide/attribute-directives.jade | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/docs/ts/latest/guide/attribute-directives.jade b/public/docs/ts/latest/guide/attribute-directives.jade index 68ffcd821f..5917fb9662 100644 --- a/public/docs/ts/latest/guide/attribute-directives.jade +++ b/public/docs/ts/latest/guide/attribute-directives.jade @@ -83,6 +83,7 @@ a#write-directive :marked ## Build a simple attribute directive ## 创建一个简单的属性型指令 + An attribute directive minimally requires building a controller class annotated with `@Directive`, which specifies the selector identifying the attribute associated with the directive. @@ -176,14 +177,14 @@ p each matching element, injecting an Angular `ElementRef` into the constructor. - Angular会为每个被指令匹配上的元素创建一个控制器类的实例,并把Angular的`ElementRef`注入进它的构造函数。 + Angular会为每个被指令匹配上的元素创建一个该指令控制器类的实例,并把Angular的`ElementRef`注入进它的构造函数。 `ElementRef` is a service that grants us direct access to the DOM element through its `nativeElement` property. That's all we need to set the element's background color using the browser DOM API. - `ElementRef`是一个服务,通过它的`nativeElement`属性,我们可以直接访问到这个DOM元素。 - 我们所要做的,就是使用浏览器的DOM API来设置这个元素的背景色。 + `ElementRef`是一个服务,通过它的`nativeElement`属性,我们可以直接访问到指令所在DOM元素。 + 这就是使用浏览器的DOM API来设置这个元素的背景色所需要我们做的全部。 .l-main-section a#apply-directive