I am using the bootstrap datetimepicker in angular 2
https://eonasdan.github.io/bootstrap-datetimepicker/
In my template i have:
<div class='input-group date datepicker'>
<input type='text' class="form-control" [(ngModel)]="date">
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar" (click)="getCalendar()"></span>
</span>
{{date}}
</div>
The problem is when I select a date on the calendar by click, it does not trigger any "change" event (in other words, ngModel
is not fired). If i type in the text box, then the {{date}}
shows me the value plus the text i typed.
How can I detect changes on the text box if the user clicks on a date in the selector to change it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…