Open jonrimmer opened 5 years ago
I propose put input values(hours
, minutes
, seconds
) to store, and define a selector function that returns validities.
so, validities will always sync with the latest input values.
this.validities$ = _store.select(selectValidities());
<ng-container *ngIf="validities$ | async as validities">
<td class="form-group" [class.has-error]="validities.invalidHours">
<input type="text" [class.is-invalid]="validities.invalidHours"
...
I think I can create PR if needed.
Bug description or feature request:
If you add an invalid value to a timepicker, the invalid value is highlighted in red in the UI. If you then change another field, the invalid field is reset.
Plunker/StackBlitz that reproduces the issue:
https://stackblitz.com/edit/timepicker-broken-validation?file=src%2Fapp%2Fapp.component.html
Versions of ngx-bootstrap, Angular, and Bootstrap:
ngx-bootstrap: 3.3.0
Angular: 7.2.7
Bootstrap: 4
Build system: Angular CLI, System.js, webpack, starter seed:
Angular CLI