I have a ngb-timepicker bound to a time structure (hour/minute). When the page loads, the time is set.
But if i change the time on click of a button (e.g., if i have some defaults that the user can tap and the timepicker shows that time), the model is updated, but the timepicker still displays the old time.
http://plnkr.co/edit/q8T9PLSFRUVq42KIds85?p=preview
Angular: 4
@ng-bootstrap/ng-bootstrap: 1.0.0-beta.5
Bootstrap - 4.0.0-alpha.6
Issue is reproducible by modifying the plunker example on the demo page.
You need to assign a new _instance_ of the time object: this.time = {hour: 20, minute: 45};:
http://plnkr.co/edit/kWQG1RsFHNdlo5AS0Fy6?p=preview
Otherwise ngModel will not see the change and will not inform timepicker of the change.
Sorry, there is nothing we can do about it here, this is how ngModel works...
Closing as any eventual change would have to happen in the Angular forms, we can't work-around it here in the library.
Most helpful comment
You need to assign a new _instance_ of the time object:
this.time = {hour: 20, minute: 45};:http://plnkr.co/edit/kWQG1RsFHNdlo5AS0Fy6?p=preview
Otherwise
ngModelwill not see the change and will not inform timepicker of the change.Sorry, there is nothing we can do about it here, this is how
ngModelworks...Closing as any eventual change would have to happen in the Angular forms, we can't work-around it here in the library.