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
18 lines (15 loc) • 403 B
text/typescript
import {Component} from '@angular/core';
import {Store} from '@ngrx/store';
import * as actions from '../actions/index';
({
selector: 'fountain-header',
template: require('./Header.html')
})
export class HeaderComponent {
constructor(public store: Store<any[]>) {}
handleSave(text: string) {
if (text.length !== 0) {
this.store.dispatch(actions.addTodo(text));
}
}
}