-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(timepicker): fix custom validation demo
- Loading branch information
1 parent
099f55c
commit 083e8e8
Showing
2 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
9 changes: 7 additions & 2 deletions
9
demo/src/app/components/+timepicker/demos/custom-validation/custom-validation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
<p>Illustrates custom validation, you have to select time between 11:00 and 12:59</p> | ||
|
||
<div class="form-group" [class.has-success]="ctrl.valid" [class.has-danger]="!ctrl.valid"> | ||
<div class="form-group"> | ||
<timepicker [(ngModel)]="myTime" [formControl]="ctrl" required></timepicker> | ||
</div> | ||
|
||
<pre class="alert alert-info">Time is: {{myTime}}</pre> | ||
<pre class="alert" | ||
[class.alert-danger]="!ctrl.valid && !ctrl.pristine" | ||
[class.alert-success]="ctrl.valid && !ctrl.pristine"> | ||
Time is: {{myTime}} | ||
</pre> | ||
<div class="alert alert-danger" *ngIf="ctrl.errors && ctrl.errors['outOfRange']">Invalid time</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters