I have an Angular2.0 component:
import {Component, View, FORM_DIRECTIVES} from 'angular2/angular2';
@Component({
selector: 'font-size-component',
properties: ['fontSize'],
events: ['fontSizeChanged']
})
@View({
template: `<input id="fontSize" [(ng-model)]="fontSize"/>`,
directives: [FORM_DIRECTIVES]
})
export class FontSizeComponent {
constructor() {
}
}
Now, I want this component to trigger an event (using event-binding) when the input changes.
On Angular 1.X I had several options (ng-change or $scope.$wacth). I am looking for a similar solution, so when the input changes I will be able to use eventemitter and trigger an fontSizeChanged event.
Thanks,
Yaniv