Skip to content

control-flow command freeze #54587

@Sp1r1tus

Description

@Sp1r1tus

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

core

Is this a regression?

No

Description

make a new project and change the app.component.html with this content:

<ng-container *ngIf="true">
  <component-name-with-lots-of-minus></component-name-with-lots-of-minus
></ng-container>

run the command

ng g @angular/core:control-flow

image

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

freeze because lots of "-" and ">" is on last line

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

package.json:

{
  "name": "test",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "serve:ssr:test": "node dist/test/server/server.mjs"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^17.2.0",
    "@angular/common": "^17.2.0",
    "@angular/compiler": "^17.2.0",
    "@angular/core": "^17.2.0",
    "@angular/forms": "^17.2.0",
    "@angular/platform-browser": "^17.2.0",
    "@angular/platform-browser-dynamic": "^17.2.0",
    "@angular/platform-server": "^17.2.0",
    "@angular/router": "^17.2.0",
    "@angular/ssr": "^17.2.1",
    "express": "^4.18.2",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.14.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^17.2.1",
    "@angular/cli": "^17.2.1",
    "@angular/compiler-cli": "^17.2.0",
    "@types/express": "^4.17.17",
    "@types/jasmine": "~5.1.0",
    "@types/node": "^18.18.0",
    "jasmine-core": "~5.1.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "typescript": "~5.3.2"
  }
}

Anything else?

in my case the component was very long and prettier doesn't change the ">" from the last line.

If the template looks like this, it works!

<ng-container *ngIf="true">
  <component-name-with-lots-of-minus></component-name-with-lots-of-minus>
</ng-container>

if you need something else let me know.

And SORRY this is my first issue, if i forgot something. Please be considerate :-)

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)state: has PR

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions