File tree Expand file tree Collapse file tree
examples/attribute-directives/src/app Expand file tree Collapse file tree Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -14,7 +14,14 @@ This section walks you through creating a highlight directive that sets the back
1414
1515 The CLI creates ` src/app/highlight.directive.ts ` , a corresponding test file ` src/app/highlight.directive.spec.ts ` .
1616
17- <docs-code header =" highlight.directive.ts " path =" adev/src/content/examples/attribute-directives/src/app/highlight.directive.0.ts " />
17+ ``` angular-ts
18+ import {Directive} from '@angular/core';
19+
20+ @Directive({
21+ selector: '[appHighlight]',
22+ })
23+ export class HighlightDirective {}
24+ ```
1825
1926 The ` @Directive() ` decorator's configuration property specifies the directive's CSS attribute selector, ` [appHighlight] ` .
2027
@@ -25,11 +32,13 @@ This section walks you through creating a highlight directive that sets the back
2532
26331 . Add logic to the ` HighlightDirective ` class that sets the background to yellow.
2734
28- <docs-code header =" highlight.directive.ts " path =" adev/src/content/examples/attribute-directives/src/app/highlight.directive.1.ts " />
35+ <docs-code header =" highlight.directive.ts " path =" adev/src/content/examples/attribute-directives/src/app/highlight.directive.1.ts " />
2936
30- HELPFUL : Directives _ do not_ support namespaces.
37+ IMPORTANT : Directives _ do not_ support namespaces.
3138
32- <docs-code header =" app.component.avoid.html (unsupported) " path =" adev/src/content/examples/attribute-directives/src/app/app.component.avoid.html " region =" unsupported " />
39+ ``` angular-html {avoid}
40+ <p app:Highlight>This is invalid</p>
41+ ```
3342
3443## Applying an attribute directive
3544
You can’t perform that action at this time.
0 commit comments