angular - angular2 change of datepicker's date can't trigger ngModelChange -


in html:

<input mdinput [(ngmodel)]="start" (ngmodelchange)="change()"          [mddatepicker]="picker" placeholder="choose date"> <md-datepicker-toggle mdsuffix [for]="picker"></md-datepicker-toggle> <md-datepicker #picker></md-datepicker> 

and in component.ts:

class component {   public start: date;   public change() {     console.log(111);   } } 

on web page, if click toggle change datepicker's date. print 111 in console. if change date in ts file this.start = new date(), not print 111. datepicker on web page has changed.

try (datechange)="nameofyourfunction($event)"


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -