You could use the ngModelChange
event:
[(ngModel)]="variable" (ngModelChange)="doSomething($event)"
Edit
According to your comment, I think that you should use form control with a custom validator.
Here is a sample:
@Component({
(...)
template: `
<input [(ngModel)]="variable" [ngFormControl]="ctrl"/>
`
})
export class SomeComponent {
constructor() {
this.ctrl = new Control('', (control) => {
// validate the value
});
this.ctrl.valueChanges.subscribe((value) => {
// called when the value is updated
});
}
}
See this article for more details:
- http://restlet.com/blog/2016/02/11/implementing-angular2-forms-beyond-basics-part-1/