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
33 lines (28 loc) • 696 B
JavaScript
angular
.module('app')
.component('footerComponent', {
templateUrl: 'app/components/Footer.html',
controller: Footer,
bindings: {
completedCount: '<',
activeCount: '<',
selectedFilter: '<filter',
onClearCompleted: '&',
onShow: '&'
}
});
function Footer() {
this.filters = [SHOW_ALL, SHOW_ACTIVE, SHOW_COMPLETED];
this.filterTitles = {};
this.filterTitles[SHOW_ALL] = 'All';
this.filterTitles[SHOW_ACTIVE] = 'Active';
this.filterTitles[SHOW_COMPLETED] = 'Completed';
}
Footer.prototype = {
handleClear: function () {
this.onClearCompleted();
},
handleChange: function (filter) {
this.onShow({filter: filter});
}
};