8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign u 8000 p 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
I'm submitting a ...
[x] bug report => search github for a similar issue or PR before submitting
Current behavior When using ngModel and trackBy in <select> the initial value is not selected when it is an object.
<select>
Expected behavior Initial value should be selected.
Minimal reproduction of the problem with instructions HTML:
<select [(ngModel)]="selectedItem"> <option *ngFor="let item of items; trackBy:itemIdentity" [value]="item"> {{item.name}} </option> </select>
TS:
private items = [{id: 0, name: 'first'}, {id: 1, name: 'second'}]; private selectedItem = {id: 1, name: 'second'}; itemIdentity(index:number, item:any):any { return item.id; }
The text was updated successfully, but these errors were encountered:
Select doesn't use trackBy function from ngFor for comparing options. Duplicate of #13268
trackBy
ngFor
Sorry, something went wrong.
@pkozlowski-opensource was fixed here #13349
Fixed via f89d004, thnx @DzmitryShylovich
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.
No branches or pull requests
I'm submitting a ...
Current behavior
When using ngModel and trackBy in
<select>
the initial value is not selected when it is an object.Expected behavior
Initial value should be selected.
Minimal reproduction of the problem with instructions
HTML:
TS:
The text was updated successfully, but these errors were encountered: