Changed For and If directive to NgFor and NgIf in the user-input section
This commit is contained in:
parent
d61e884e08
commit
0d04f161aa
|
@ -66,12 +66,12 @@
|
|||
.l-main-section
|
||||
h2#section-display-the-list-of-todos Display the list of todos
|
||||
p.
|
||||
Using the <code>*for</code> iterator, create an <code><li></code> for each item in the todos array and set
|
||||
Using the <code>*ng-for</code> iterator, create an <code><li></code> for each item in the todos array and set
|
||||
its text to the value.
|
||||
|
||||
code-example(language="html" format="linenums").
|
||||
<ul>
|
||||
<li *for="#todo of todos">
|
||||
<li *ng-for="#todo of todos">
|
||||
{{ todo }}
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -107,7 +107,7 @@
|
|||
code-tabs
|
||||
code-pane(language="javascript" name="TypeScript" format="linenums").
|
||||
//TypeScript
|
||||
import {Component, View, bootstrap, For, If} from 'angular2/angular2';
|
||||
import {Component, View, bootstrap, NgFor, NgIf} from 'angular2/angular2';
|
||||
|
||||
@Component({
|
||||
selector: 'todo-list'
|
||||
|
@ -115,7 +115,7 @@
|
|||
@View({
|
||||
template: `
|
||||
<ul>
|
||||
<li *for="#todo of todos">
|
||||
<li *ngfor="#todo of todos">
|
||||
{{ todo }}
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -123,7 +123,7 @@
|
|||
<input #todotext (keyup)="doneTyping($event)">
|
||||
<button (click)="addTodo(todotext.value)">Add Todo</button>
|
||||
`,
|
||||
directives: [For, If]
|
||||
directives: [NgFor, NIf]
|
||||
})
|
||||
class TodoList {
|
||||
todos: Array<string>;
|
||||
|
@ -169,13 +169,13 @@
|
|||
new angular.ViewAnnotation({
|
||||
template:
|
||||
'<ul>' +
|
||||
'<li *for="#todo of todos">' +
|
||||
'<li *ng-for="#todo of todos">' +
|
||||
'{{ todo }}' +
|
||||
'</li>' +
|
||||
'</ul>' +
|
||||
'<input #textbox (keyup)="doneTyping($event)">' +
|
||||
'<button (click)="addTodo(textbox.value)">Add Todo</button>',
|
||||
directives: [angular.For, angular.If]
|
||||
directives: [angular.NgFor, angular.NgIf]
|
||||
})
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in New Issue