-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(select): integrate with angular forms
- Loading branch information
Showing
8 changed files
with
251 additions
and
33 deletions.
There are no files selected for viewing
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
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,5 +1,11 @@ | ||
<div class="demo-select"> | ||
<md-select placeholder="Food"> | ||
<md-option *ngFor="let food of foods"> {{ food.viewValue }} </md-option> | ||
<md-select placeholder="Food" [formControl]="control" [required]="isRequired"> | ||
<md-option *ngFor="let food of foods" [value]="food.value"> {{ food.viewValue }} </md-option> | ||
</md-select> | ||
<p> Value: {{ control.value }} </p> | ||
<p> Touched: {{ control.touched }} </p> | ||
<p> Dirty: {{ control.dirty }} </p> | ||
<p> Status: {{ control.status }} </p> | ||
<button md-button (click)="control.setValue('pizza-1')">SET VALUE</button> | ||
<button md-button (click)="isRequired=!isRequired">TOGGLE REQUIRED</button> | ||
</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
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
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
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
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
Oops, something went wrong.