Skip to content

Control flow migration: whitespace + new lines in condition produces invalid code #53428

Closed

Description

@mattlewis92

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

core

Is this a regression?

No

Description

This is a follow up to #53386, I think this is the last issue now 😃

Input:

<ng-template
  [ngIf]="customClearTemplate"
  [ngIfElse]="
    isSidebarV3 || variant === 'v3' ? clearTemplateV3 : clearTemplate
  "
></ng-template>

Output:

@if (customClearTemplate) {
} @else {
  θ
  isSidebarV3 || variant === 'v3' ? clearTemplateV3 : clearTemplate
  δ
}

Expected output:

@if (customClearTemplate) {
} @else {
  <ng-template [ngTemplateOutlet]="isSidebarV3 || variant === 'v3' ? clearTemplateV3 : clearTemplate"></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.6+sha-543df3d
... 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 build from the main branch via "@angular/core": "angular/core-builds#17.0.6+543df3d"

Activity

  1. added
    area: migrations
    core: control flow
    on Dec 7, 2023
  2. self-assigned this
    on Dec 7, 2023
  3. modified the milestone: needsTriage on Dec 7, 2023
  4. added a commit that references this issue on Dec 7, 2023
    a7f964f
  5. jessicajaniuk commented on Dec 7, 2023

    @jessicajaniuk
    Contributor

    Fix is in #53435.

  6. added a commit that references this issue on Dec 8, 2023
    96ab999
  7. mattlewis92 commented on Dec 11, 2023

    @mattlewis92
    ContributorAuthor

    After the latest build, everything in our application now migrates flawlessly 🥳 Thank you so much!!

  8. angular-automatic-lock-bot commented on Jan 11, 2024

    @angular-automatic-lock-bot

    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.

  9. locked and limited conversation to collaborators on Jan 11, 2024
  10. added a commit that references this issue on Jan 23, 2024
    f12741f
  11. added a commit that references this issue on Jan 26, 2024
    8406a6c
  12. added a commit that references this issue on Jan 26, 2024
    bd40743
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: migrationscore: control flowstate: has PR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions