angular-nevera-generator
Version:
Yeoman AngularJS scaffold a webapp with Angular 1 written in ES6 (Babel), TypeScript through Webpack or SystemJS including tools Gulp 4, ESLint, Browsersync and Karma
24 lines (20 loc) • 415 B
text/typescript
class Header {
todos: Todo[];
/** @ngInject */
constructor(public todoService: TodoService) {
}
handleSave(text: string) {
if (text.length !== 0) {
this.todos = this.todoService.addTodo(text, this.todos);
}
}
}
angular
.module('app')
.component('headerComponent', {
templateUrl: 'app/components/Header.html',
controller: Header,
bindings: {
todos: '='
}
});