-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Description
Bug, feature request, or proposal:
Feature request/ bug.
What is the expected behavior?
Needs a "selected" attribute so the developer can specify the "selected" rule/logic.
What is the current behavior?
Option not being selected although the underlying model is populated.
What are the steps to reproduce?
Unable to select options using objects where some properties of the two objects differ yet primary key and Display value are the same. For example,
<md-option *ngFor="let user of Users" [value]="user">
{{ user.name }}
</md-option>
The user may have one set of data inside the model yet only retrieve a subset of the properties to populate the 5DE9 select list. In this case, the options of the select do not select.
For such cases, it may be better to do something like:
<md-option *ngFor="let user of Users" [value]="user" [selected]="user.id === userId">
{{ user.name }}
</md-option>
What is the use-case or motivation for changing an existing behavior?
Using forms where objects are part of the underlying model. These objects are used as values of each .
Which versions of Angular, Material, OS, browsers are affected?
Angular 2 latest.
Is there anything else we should know?
rafaellyra, armasson, richardklose, da45, genereux and 10 more
Metadata
Metadata
Assignees
Labels
No labels