Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Angular control flow is not formatted in components if using the new simple naming like user-input.ts #18871

@adammolnar

Description

@adammolnar

Since Angular v20 it is not encouraged any more to use the naming convention user-input.component.ts for components. Instead it is encouraged to use a simpler naming like user-input.ts. If so, the control flow blocks @if() or @for() are not formatted correctly any more.
Using Prettier 3.8.1 in Webstorm 2025.3.2
Not replicable in https://prettier.io/playground)

user-input.component.html

<div>
  @for (item of model; track item) {
    @if (item === "test") {
      <div>{{ item }}</div>
    }
  }
</div>

user-input.html

<div>
  @for (item of model; track item) { @if (item === 'test') {
  <div>{{ item }}</div>
  } }
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:angularIssues affecting Angular template (not general JS/TS issues used for Angular)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions