Skip to content

fix: 🐛 @angular/core-control-flow schematic issues #53169

@bjornharvold

Description

@bjornharvold

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

No

Description

The example contains a component that could really benefit from the new control flow.

There are several issues I noticed when running the migration schematic:

  • ng-template elements are not removed
  • recursion not handled very well. looks like a lot of duplication occurring.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/~/github.com/bjornharvold/angular-control-flow

Please provide the exception or error you saw

Stackblitz shows the project before the schematic being applied. 

To reproduce, execute the schematic:

`ng g @angular/core:control-flow`

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 17.0.3
Node: 20.9.0
Package Manager: yarn 1.22.21
OS: darwin arm64

Angular: 17.0.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.3
@angular-devkit/build-angular   17.0.3
@angular-devkit/core            17.0.3
@angular-devkit/schematics      17.0.3
@angular/cli                    17.0.3
@schematics/angular             17.0.3
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2

Anything else?

No response

Metadata

Metadata

Assignees

Labels

area: migrationsIssues related to `ng update`/`ng generate` migrationscore: control flowIssues related to the built-in control flow (@if, @for, @switch)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions