-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(autocomplete): add value support
- Loading branch information
Showing
9 changed files
with
217 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
<div class="demo-autocomplete"> | ||
<md-input-container> | ||
<input md-input placeholder="State" [mdAutocomplete]="auto"> | ||
</md-input-container> | ||
<md-card> | ||
<md-input-container> | ||
<input md-input placeholder="State" [mdAutocomplete]="auto" [formControl]="stateCtrl"> | ||
</md-input-container> | ||
|
||
<md-autocomplete #auto="mdAutocomplete"> | ||
<md-option *ngFor="let state of states" [value]="state.code"> {{ state.name }} </md-option> | ||
</md-autocomplete> | ||
<md-autocomplete #auto="mdAutocomplete"> | ||
<md-option *ngFor="let state of filteredStates" [value]="state.code"> {{ state.name }} </md-option> | ||
</md-autocomplete> | ||
</md-card> | ||
<md-card> | ||
<div>Value: {{ stateCtrl.value }}</div> | ||
<div>Status: {{ stateCtrl.status }}</div> | ||
<div>Dirty: {{ stateCtrl.dirty }}</div> | ||
<md-card-actions> | ||
<button md-button (click)="stateCtrl.reset()">RESET</button> | ||
<button md-button (click)="stateCtrl.setValue('CA')">SET VALUE</button> | ||
<button md-button (click)="stateCtrl.enabled ? stateCtrl.disable() : stateCtrl.enable()"> | ||
TOGGLE DISABLED | ||
</button> | ||
</md-card-actions> | ||
</md-card> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
.demo-autocomplete {} | ||
.demo-autocomplete { | ||
display: flex; | ||
flex-flow: row wrap; | ||
|
||
md-card { | ||
width: 350px; | ||
margin: 24px; | ||
} | ||
} |
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.