Created
August 4, 2015 06:13
-
-
Save joeeames/842da0f8d9b30dd01790 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component, View, bootstrap} from 'angular2/angular2'; | |
// import {NewItem} from 'components/new-item'; | |
import {TodoList} from 'components/todo-list'; | |
import {TodoItemsService} from 'services/TodoItemsService'; | |
@Component({ | |
selector: 'todo-app' | |
}) | |
@View({ | |
templateUrl: 'components/app.html', | |
directives: [TodoList] | |
}) | |
export class TodoApp { | |
constructor() { | |
} | |
// other methods | |
} | |
bootstrap(TodoApp, [TodoItemsService]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component, View, coreDirectives, EventEmitter} from 'angular2/angular2'; | |
import {Inject, bind} from 'angular2/di'; | |
import {TodoItemsService} from 'services/TodoItemsService'; | |
@Component({ | |
selector: 'todo-list', | |
}) | |
@View({ | |
templateUrl: 'components/todo-list.html', | |
directives: [coreDirectives] | |
}) | |
export class TodoList { | |
constructor(@Inject('TodoItemsService') todoItems) { | |
this.items = todoItems.items; | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable} from 'angular2/angular2'; | |
@Injectable() | |
export class TodoItemsService { | |
items: array = []; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment