generator-fountain-angular2
Version:
Yeoman Fountain generator to scaffold a webapp with Angular 2 written in ES6 (Babel), TypeScript through Webpack or SystemJS including tools Gulp 4, ESLint, Browsersync and Karma
34 lines (30 loc) • 829 B
text/typescript
import {Component, Input, Output, EventEmitter} from '@angular/core';
import {SHOW_ALL, SHOW_COMPLETED, SHOW_ACTIVE} from '../constants/TodoFilters';
({
selector: 'fountain-footer',
template: require('./Footer.html'),
styles: [`
a {
cursor: pointer
}
`]
})
export class FooterComponent {
() completedCount;
() activeCount;
() filter;
() onClearCompleted: EventEmitter<any> = new EventEmitter(false);
() onShow: EventEmitter<any> = new EventEmitter(false);
filters = [SHOW_ALL, SHOW_ACTIVE, SHOW_COMPLETED];
filterTitles = {
[SHOW_ALL]: 'All',
[SHOW_ACTIVE]: 'Active',
[SHOW_COMPLETED]: 'Completed'
};
handleClear(e: any) {
this.onClearCompleted.emit(e);
}
handleChange (filter: string) {
this.onShow.emit(filter);
}
}