This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree 3 files changed +9
-2
lines changed
_examples/attribute-directives
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
<!-- #docregion -->
2
2
< h1 > My First Attribute Directive</ h1 >
3
3
< p myHighlight > Highlight me!</ p >
4
+ <!-- #enddocregion -->
5
+ <!-- #docregion p-style-background -->
6
+ < p [style.background] ="'lime' "> I am green with envy!</ p >
7
+ <!-- #enddocregion p-style-background -->
Original file line number Diff line number Diff line change 2
2
< h1 > My First Attribute Directive</ h1 >
3
3
< p myHighlight > Highlight me!</ p >
4
4
<!-- #enddocregion -->
5
+ <!-- #docregion p-style-background -->
6
+ < p [style.background] ="'lime' "> I am green with envy!</ p >
7
+ <!-- #enddocregion p-style-background -->
Original file line number Diff line number Diff line change 36
36
:marked
37
37
We don't need *any* directive to simply set the background color.
38
38
We can set it with the special [Style Binding](template-syntax.html#style-binding) like this:
39
- code-example ( language = "html" escapse = "html" ) .
40
- < p [style.background] = " 'lime' " >I am green with envy!</ p >
39
+
40
+ + makeExample( 'attribute-directives/ts/app/app.component.1.html' , 'p-style-background' )
41
41
42
42
:marked
43
43
That wouldn't be nearly as much fun as creating our own directive.
You can’t perform that action at this time.
0 commit comments