diff --git a/public/docs/_examples/homepage-todo/ts/app/todo_app.ts b/public/docs/_examples/homepage-todo/ts/app/todo_app.ts index 5688868b73..ca444d4ef6 100644 --- a/public/docs/_examples/homepage-todo/ts/app/todo_app.ts +++ b/public/docs/_examples/homepage-todo/ts/app/todo_app.ts @@ -1,8 +1,8 @@ // #docregion import {Component} from 'angular2/core'; -import {Todo} from './todo'; -import {TodoList} from './todo_list'; -import {TodoForm} from './todo_form'; +import {Todo} from './todo'; +import {TodoList} from './todo_list'; +import {TodoForm} from './todo_form'; @Component({ selector: 'todo-app', @@ -18,19 +18,19 @@ import {TodoForm} from './todo_form'; }) export class TodoApp { todos: Todo[] = [ - {text:'learn angular', done:true}, - {text:'build an angular app', done:false} + {text: 'learn angular', done: true}, + {text: 'build an angular app', done: false} ]; get remaining() { - return this.todos.reduce((count: number, todo: Todo) => count + +!todo.done, 0); + return this.todos.filter(todo => !todo.done).length; } archive(): void { - var oldTodos = this.todos; + let oldTodos = this.todos; this.todos = []; - oldTodos.forEach((todo: Todo) => { - if (!todo.done) this.todos.push(todo); + oldTodos.forEach(todo => { + if (!todo.done) { this.todos.push(todo); } }); }