Reputation: 789
I'm using ng2-datepicker the html looks like this.
<datepicker [(ngModel)]="selectedDate"></datepicker>
I'm not sure how to run a function when the date is changed when using two-way data binding.
Upvotes: 1
Views: 1318
Reputation: 3315
Just use
<datepicker [(ngModel)]="selectedDate" (ngModelChange)="myHandler($event)"></datepicker>
ngModelChange
will call the handler, and the value of $event
will be the new value of the ngModel
.
Upvotes: 2