Title: trackBy in *ngFor not working in
Open Graph Title: trackBy in *ngFor not working in
X Title: trackBy in *ngFor not working in
Description: 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
Open Graph Description: 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
X Description: 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 se...
Opengraph URL: https://github.com/angular/angular/issues/13828
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"trackBy in *ngFor not working in \u003cselect>? ","articleBody":"**I'm submitting a ...**\r\n```\r\n[x] bug report => search github for a similar issue or PR before submitting\r\n```\r\n\r\n**Current behavior**\r\nWhen using ngModel and trackBy in `\u003cselect>` the initial value is not selected when it is an object. \r\n\r\n**Expected behavior**\r\nInitial value should be selected.\r\n\r\n**Minimal reproduction of the problem with instructions**\r\nHTML:\r\n\r\n```\r\n\u003cselect [(ngModel)]=\"selectedItem\">\r\n \u003coption *ngFor=\"let item of items; trackBy:itemIdentity\" [value]=\"item\">\r\n {{item.name}}\r\n \u003c/option>\r\n\u003c/select>\r\n```\r\n\r\nTS:\r\n```\r\nprivate items = [{id: 0, name: 'first'}, {id: 1, name: 'second'}];\r\nprivate selectedItem = {id: 1, name: 'second'};\r\n\r\nitemIdentity(index:number, item:any):any {\r\n return item.id;\r\n}\r\n```\r\n\r\n\r\n\r\n* **Angular version:** 2.4.1\r\n* **Browser:** Chrome\r\n* **Language:** TypeScript X.X","author":{"url":"https://github.com/joostvandoremalen","@type":"Person","name":"joostvandoremalen"},"datePublished":"2017-01-07T10:20:57Z","url":"https://github.com/angular/angular/issues/13828"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b537b41b-1055-07ee-f2fb-47ad91101c25 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E658:2D2F2F:158E879:1BA5CAA:6B012122 |
| html-safe-nonce | 0a5e8c2aa09d6c54e22da6728fee58ac21af0b38d3a868e49b6b36343b7f692c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjU4OjJEMkYyRjoxNThFODc5OjFCQTVDQUE6NkIwMTIxMjIiLCJ2aXNpdG9yX2lkIjoiMTE3NDUxMTkyNDc0Njk4NTc2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3e7ded2f4b51ade4e92f18719c21aaed5af3702944e7e498c0c56db47888eba4 |
| hovercard-subject-tag | issue:199353993 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/13828/issue_layout |
| twitter:image | https://opengraph.githubassets.com/237c19b411e4df1dde18e8009e9c1c732aa8913df0af16ab5ca901d4dcbc39e7/angular/angular/issues/13828 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/237c19b411e4df1dde18e8009e9c1c732aa8913df0af16ab5ca901d4dcbc39e7/angular/angular/issues/13828 |
| og:image:alt | 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 |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | joostvandoremalen |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width