Repository navigation
Closed
Closed
Copy link
Labels
area: migrationsIssues related to `ng update`/`ng generate` migrationscore: control flowIssues related to the built-in control flow (@if, @for, @switch)
Milestone
Description
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
Sorry, it looks like I missed a few straggling issues! 😅
Input (defaultTemplate is assumed to be a template passed in via a component input):
<button *ngIf="active; else defaultTemplate">Hello!</button>
Output:
@if (active) {
<button>Hello!</button>
} @else {
#defaultTemplate|
}
Expected output:
@if (active) {
<button>Hello!</button>
} @else {
<ng-template [ngTemplateOutlet]="defaultTemplate"></ng-template>
}
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)
Angular CLI: 17.0.5
Node: 20.9.0
Package Manager: pnpm 8.11.0
OS: darwin arm64
Angular: 17.0.5+sha-2d2eaec
... core
Package Version
-------------------------------------------------------------
@angular-devkit/architect 0.1700.1
@angular-devkit/build-angular 17.0.5
@angular-devkit/core 17.0.5
@angular-devkit/schematics 17.0.5
@angular/animations 17.0.5
@angular/cdk 17.0.1
@angular/cli 17.0.5
@angular/common 17.0.5
@angular/compiler 17.0.5
@angular/compiler-cli 17.0.5
@angular/elements 17.0.5
@angular/forms 17.0.5
@angular/google-maps 15.2.9
@angular/language-service 17.0.5
@angular/localize 17.0.5
@angular/platform-browser 17.0.5
@angular/platform-browser-dynamic 17.0.5
@angular/router 17.0.5
@angular/service-worker 17.0.5
@schematics/angular 17.0.5
ng-packagr 17.0.2
rxjs 7.8.0
typescript 5.2.2
webpack 5.88.2
zone.js 0.14.2
Anything else?
This is using the latest core-builds version via "@angular/core": "angular/core-builds#17.0.5+2d2eaec",
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)
Activity
jessicajaniuk commentedon Dec 5, 2023
Ah, yeah this wouldn't migrate properly because the ng-template does not exist in the same component template. I think I can handle this case.
fix(migrations): handle templates outside of component in cf migration
jessicajaniuk commentedon Dec 5, 2023
Fix is in #53368. Thanks!
fix(migrations): handle templates outside of component in cf migration (
angular-automatic-lock-bot commentedon Jan 6, 2024
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
fix(migrations): handle templates outside of component in cf migration (
fix(migrations): handle templates outside of component in cf migration (
fix(migrations): handle templates outside of component in cf migration (