Commit cbfa0c87 authored by Colin Eberhardt's avatar Colin Eberhardt Committed by Sam Saccone

Use dependency injection

parent 60c55a87
......@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
var core_1 = require('angular2/core');
var store_1 = require('./services/store');
var TodoApp = (function () {
function TodoApp() {
function TodoApp(todoStore) {
this.newTodoText = '';
this.todoStore = new store_1.TodoStore();
this.todoStore = todoStore;
}
TodoApp.prototype.stopEditing = function (todo, editedTitle) {
todo.title = editedTitle;
......@@ -52,7 +52,7 @@ var TodoApp = (function () {
selector: 'todo-app',
templateUrl: 'app/app.html'
}),
__metadata('design:paramtypes', [])
__metadata('design:paramtypes', [store_1.TodoStore])
], TodoApp);
return TodoApp;
})();
......
......@@ -9,8 +9,8 @@ export default class TodoApp {
todoStore: TodoStore;
newTodoText = '';
constructor() {
this.todoStore = new TodoStore();
constructor(todoStore: TodoStore) {
this.todoStore = todoStore;
}
stopEditing(todo: Todo, editedTitle: string) {
......
var browser_1 = require('angular2/platform/browser');
var app_1 = require('./app');
browser_1.bootstrap(app_1.default);
var store_1 = require('./services/store');
browser_1.bootstrap(app_1.default, [store_1.TodoStore]);
//# sourceMappingURL=bootstrap.js.map
\ No newline at end of file
import {bootstrap} from 'angular2/platform/browser';
import TodoApp from './app'
import {TodoStore} from './services/store';
bootstrap(TodoApp);
bootstrap(TodoApp, [TodoStore]);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment