docs(attribute-directives): small fixes.

closes #618
This commit is contained in:
Kion Stephen 2015-12-28 21:55:13 -04:00 committed by Ward Bell
parent af458737be
commit 7269d3481d

View File

@ -81,11 +81,17 @@ include ../../../../_includes/_util-fns
:marked :marked
### Why not call it "highlight"? ### Why not call it "highlight"?
*highlight* is a nicer name than *myHighlight* and, technically, it would work if we called it that. *highlight* is a nicer name than *myHighlight* and, technically, it would work if we called it that.
However, the good folks at Angular strongly prefer hyphenated directive selector names.
The HTML standards body will never name one of its attributes with a hyphen and there is However, we recommend picking a selector name with a prefix to ensure
less risk of colliding with a third-party directive name when we give ours a prefix. that it cannot conflict with any standard HTML attribute, now or in the future.
The `ng` prefix belongs to Angular. There is also less risk of colliding with a third-party directive name when we give ours a prefix.
We do **not** prefix our `highlight` directive name with **`ng`**.
That prefix belongs to Angular and
we don't want to confuse our directives with their directives.
We need a prefix of our own, preferably short, and `my` will do for now. We need a prefix of our own, preferably short, and `my` will do for now.
:marked :marked
After the `@Directive` metadata comes the directive's controller class which we are exporting After the `@Directive` metadata comes the directive's controller class which we are exporting
to make it accessible to other components. to make it accessible to other components.
@ -355,7 +361,7 @@ figure.image-display
In all previous bindings, the directive or component property was a binding ***source***. In all previous bindings, the directive or component property was a binding ***source***.
A property is a *source* if it appears in the template expression to the ***right*** of the (=). A property is a *source* if it appears in the template expression to the ***right*** of the (=).
A property is a *target* when it appears to the ***left** of the (=) ... A property is a *target* when it appears to the **left** of the (=) ...
as it is does when we bind to the `myHighlight` property of the `HighlightDirective`, as it is does when we bind to the `myHighlight` property of the `HighlightDirective`,
+makeExample('attribute-directives/ts/app/app.component.html','span')(format=".") +makeExample('attribute-directives/ts/app/app.component.html','span')(format=".")
:marked :marked