Wip/kgs/ng 21 update#10
Conversation
- Ran `nx migrate latest`. - Had to manually update `jest`.
| [class]="cx('link')" | ||
| (click)="handleClick($event, item.value)" | ||
| > | ||
| @for (star of item.stars; track star) { |
There was a problem hiding this comment.
item.stars is typed as boolean[], so each star value is simply true or false. Since Angular's new @for requires a unique tracking expression, tracking by star may not be unique when multiple items have the same value and will throw a runtime error.
I think we should track by index instead:
@for (star of item.stars; track $index) {
| <div class="media-body"> | ||
| <h4 class="media-heading"> | ||
| <ais-highlight [hit]="hit" attribute="title"></ais-highlight> | ||
| @for (star of hit.stars; track star) { |
There was a problem hiding this comment.
hit.stars is typed as boolean[], so each star value is simply true or false. Since Angular's new @for requires a unique tracking expression, tracking by star may not be unique when multiple items have the same value and will throw a runtime error.
I think we should track by index instead:
@for (star of hit.stars; track $index) {
| <ais-hits> | ||
| <ng-template let-hits="hits"> | ||
| <ol class="ais-Hits-list"> | ||
| @for (item of hits; track item) { |
There was a problem hiding this comment.
I thinktrack item.valueis better here.
Angular 21 update via Nx migration.