Skip to content

Nested for loops reset parent even/odd #52917

@jjw99

Description

@jjw99

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

Metadata

Metadata

Assignees

Labels

area: coreIssues related to the framework runtimebugcore: control flowIssues related to the built-in control flow (@if, @for, @switch)state: has PR

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions