Skip to content

md-option viewValue #4192

Closed
Closed

Description

@Eldinnie

proposal:

I would like to set the viewValue for an option in and md-slect manually. I have the following setup:

<md-select>
  <md-option *ngFor="let data of datas" [value]="data.selector">
    {{data.val}} <md-icon>filter_{{data.num}}</md-icon> 
  </md-option>
</md-select>

What is the expected behavior?

When I select an option the text in the select should only read the text of data.val and not display the icon name aswell.

What is the current behavior?

After I selected the option the select shows the data.val and filter_3 (if the value is 3) as text.

What are the steps to reproduce?

See above

Providing a Plunker (or similar) is the best way to get the team to see your issue.
I would love to, but the plunker mentioned in this template doesn't support md-icon for some reason, wich makes it a bit difficult

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

It's pretty ugly to see an icon's name in text.

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

"@angular/material": "^2.0.0-beta.3",
"@angular/core": "^4.0.0"

Is there anything else we should know?

Activity

  1. fxck commented on Apr 21, 2017

    @fxck
    Contributor
  2. Eldinnie commented on Apr 22, 2017

    @Eldinnie
    Author

    That would be good aswell, thanks

  3. crisbeto commented on Nov 28, 2017

    @crisbeto
    Member

    Closing as something that should be possible in master.

  4. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  5. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions