docs: warn that directives don't support namespaces (#25855)

PR Close #25855
This commit is contained in:
Sergej Grilborzer 2019-02-06 09:17:13 +01:00 committed by Igor Minar
parent 6b511a33f6
commit 980bb52d36
3 changed files with 9 additions and 2 deletions

View File

@ -2,7 +2,7 @@
<h1>My First Attribute Directive</h1>
<!-- #docregion applied -->
<p appHighlight>Highlight me!</p>
<!-- #enddocregion applied, -->
<!-- #enddocregion applied -->
<!-- #docregion color-1 -->
<p appHighlight highlightColor="yellow">Highlighted in yellow</p>
@ -11,4 +11,4 @@
<!-- #docregion color-2 -->
<p appHighlight [highlightColor]="color">Highlighted with parent component's color</p>
<!-- #enddocregion color-2 -->
<!-- #enddocregion color-2 -->

View File

@ -0,0 +1,3 @@
<!-- #docregion unsupported -->
<p app:Highlight>This is invalid</p>
<!-- #enddocregion unsupported -->

View File

@ -41,6 +41,10 @@ when the user hovers over that element. You can apply it like this:
{@a write-directive}
Please note that directives _do not_ support namespaces.
<code-example path="attribute-directives/src/app/app.component.avoid.html" linenums="false" header="src/app/app.component.avoid.html (unsupported)" region="unsupported"></code-example>
### Write the directive code
Create the directive class file in a terminal window with the CLI command [`ng generate directive`](cli/generate).