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
37 lines (31 loc) • 863 B
JavaScript
var todoFilters = require('../constants/TodoFilters');
module.exports = {
<% if (modules === 'systemjs') { -%>
templateUrl: 'app/components/Footer.html',
<% } else { -%>
template: require('./Footer.html'),
<% } -%>
controller: Footer,
bindings: {
completedCount: '<',
activeCount: '<',
selectedFilter: '<filter',
onClearCompleted: '&',
onShow: '&'
}
};
function Footer() {
this.filters = [todoFilters.SHOW_ALL, todoFilters.SHOW_ACTIVE, todoFilters.SHOW_COMPLETED];
this.filterTitles = {};
this.filterTitles[todoFilters.SHOW_ALL] = 'All';
this.filterTitles[todoFilters.SHOW_ACTIVE] = 'Active';
this.filterTitles[todoFilters.SHOW_COMPLETED] = 'Completed';
}
Footer.prototype = {
handleClear: function () {
this.onClearCompleted();
},
handleChange: function (filter) {
this.onShow({filter: filter});
}
};