Skip to content

Select not set to ngModel initial value #4854

@doorman02

Description

@doorman02

Bug, feature request, or proposal:

When setting the ngModel variable in code behind onInit the selected display value is not showing.
This works in beta 5 but not anymore in beta 6

What is the expected behavior?

The select should show the display string of the ngModel value

What is the current behavior?

It does not show anything

What are the steps to reproduce?

<md-select [(ngModel)]="selectedSortBy " mdTooltip="Sort by">
              <md-option [value]="0">Latest</md-option>
              <md-option [value]="1">Highest</md-option>
              <md-option [value]="2">Lowest</md-option>
            </md-select>

and in component file onInit setting
selectedSortBy= 0;
does not display Latest

What is the use-case or motivation for changing an existing behavior?

Select should show the databound value

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Material beta.6 latest angular

Is there anything else we should know?

Metadata

Metadata

Assignees

Labels

P2The issue is important to a large percentage of users, with a workaround

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions