Displaying data clean up.
This commit is contained in:
parent
b5fdd6ba52
commit
6fe86825b5
|
@ -260,7 +260,7 @@
|
|||
new angular.Component({
|
||||
selector: "display",
|
||||
injectables: [FriendsService]
|
||||
}),
|
||||
}),
|
||||
new angular.View({
|
||||
template: '{{ myName }} <ul> <li *for="#name of names"<{{ name }}>/li< >/ul<',
|
||||
directives: [angular.For, angular.If]
|
||||
|
@ -286,7 +286,17 @@
|
|||
code.
|
||||
<p *if="names.length > 3">You have many friends!</p>
|
||||
p You'll also need to add the If directive so Angular knows to include it.
|
||||
p [TODO: CODE]
|
||||
|
||||
pre.prettyprint.lang-javascript
|
||||
code.
|
||||
//ES5
|
||||
directives: [angular.For, angular.If]
|
||||
pre.prettyprint.lang-typescript
|
||||
code.
|
||||
//Typescript
|
||||
import {Component, View, bootstrap, For, If} from
|
||||
...
|
||||
directives: [For, If]
|
||||
p.
|
||||
As there are currently 5 items it the list, you'll see the message congratulating you on your many friends.
|
||||
Remove two items from the list, reload your browser, and see that the message no longer displays.
|
||||
|
|
Loading…
Reference in New Issue