UNPKG

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

26 lines (23 loc) 505 B
module.exports = { <% if (modules === 'systemjs') { -%> templateUrl: 'app/components/Header.html', controller: ['todoService', Header], <% } else { -%> template: require('./Header.html'), controller: Header, <% } -%> bindings: { todos: '=' } }; /** @ngInject */ function Header(todoService) { this.todoService = todoService; } Header.prototype = { handleSave: function (text) { if (text.length !== 0) { this.todos = this.todoService.addTodo(text, this.todos); } } };