-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to override id attribute for mat-option #11572
Comments
Fixes consumers not being allowed to set their own id on a `mat-option`. Fixes angular#11572.
shouldnt you use [id]="mytest" ? |
Fixes consumers not being allowed to set their own id on a `mat-option`. Fixes #11572.
Fixes consumers not being allowed to set their own id on a `mat-option`. Fixes #11572.
Fixes consumers not being allowed to set their own id on a `mat-option`. Fixes angular#11572.
Fixes consumers not being allowed to set their own id on a `mat-option`. Fixes angular#11572.
Fixes consumers not being allowed to set their own id on a `mat-option`. Fixes angular#11572.
Hi @lokeshdaiya .... I overcame this bottle neck with the following solution: By creating a tag inside the , and assigning the id attribute to span tag.
Hope it helps :) Sehul. V |
Fixes consumers not being allowed to set their own id on a `mat-option`. Fixes #11572.
@Seh83 Yes that can be done but my requirement was something else thats why I needed to override |
Fixes consumers not being allowed to set their own id on a `mat-option`. Fixes #11572.
Fixes consumers not being allowed to set their own id on a `mat-option`. Fixes #11572.
@Seh83 did you found a solution? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Unable to override id attribute of mat-option although its working for mat-select because mat-select has id attribute as Input.
What is the expected behavior?
when id attribute is applied on mat-option it should assign the value
<mat-option id="mytest"> </mat-option>
so finally id should be mytest but it renders like mat-option-{{some number}}
What is the current behavior?
Currently it renders
id
like mat-option-{{some number}}What are the steps to reproduce?
Providing a StackBlitz reproduction is the best way to share your issue.
https://stackblitz.com/edit/angular-oqji4e?file=app/select-overview-example.html
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
angular 5+
material 5+
typescript 2.4+
Is there anything else we should know?
As I can see in the line id is not used as Input and it has only getter method
https://github.com/angular/material2/blob/b090f6d01a3d2ac2fbb6a10df31f6f89e6b66110/src/lib/core/option/option.ts#L98
The text was updated successfully, but these errors were encountered: