Skip to content

Wip/kgs/ng 21 update#10

Open
kschaefe wants to merge 9 commits into
masterfrom
wip/kgs/ng-21-update
Open

Wip/kgs/ng 21 update#10
kschaefe wants to merge 9 commits into
masterfrom
wip/kgs/ng-21-update

Conversation

@kschaefe

Copy link
Copy Markdown

Angular 21 update via Nx migration.

@kmiyan kmiyan requested a review from lijojoy123 June 16, 2026 13:58
[class]="cx('link')"
(click)="handleClick($event, item.value)"
>
@for (star of item.stars; track star) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thinktrack item.valueis better here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants