-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Nested for loops reset parent even/odd #52917
Copy link
Copy link
Closed
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimebugcore: 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?
core
Is this a regression?
Yes
Description
With the new control flow syntax, nested inner for loops will overwrite the value of even/odd variables stored in the parent loop.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/angular-3qegjg?file=src%2Fmain.ts
Please provide the exception or error you saw
In the stackblitz example, the value of 'odd' should be retained in the inner loop iterations.
Please provide the environment you discovered this bug in (run ng version)
17.0.2
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimebugcore: 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