-
Notifications
You must be signed in to change notification settings - Fork 27k
Closed
Closed
Copy link
Labels
area: migrationsIssues related to `ng update`/`ng generate` migrationsIssues related to `ng update`/`ng generate` migrationscore: control flowIssues related to the built-in control flow (@if, @for, @switch)Issues related to the built-in control flow (@if, @for, @switch)state: has PR
Milestone
Description
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
The control-flow migration changes code like this:
<div *ngFor="let foo of foos; index as $index;"></div>
into:
@for (foo of foos; track foo; let $index = $index) { <div></div> }
This code, while odd, compiled ok in Angular 17. It no longer compiles in Angular 18. The migration should leave off index variables that are aliased to $index.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version)
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area: migrationsIssues related to `ng update`/`ng generate` migrationsIssues related to `ng update`/`ng generate` migrationscore: control flowIssues related to the built-in control flow (@if, @for, @switch)Issues related to the built-in control flow (@if, @for, @switch)state: has PR