Skip to content

control flow migration: nested switches don't migrate properly #53009

Closed

Description

@jessicajaniuk

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

core

Is this a regression?

Yes

Description

In this comment, @marcusrettig reported that nested switches don't migrate properly.

<div [ngSwitch]="mimeTypeCategory">
  <div *ngSwitchCase="'text'" [ngSwitch]="mimeTypeExtension">
    <img *ngSwitchCase="'plain'" src="/assets/file-types/TXT.svg" alt="TXT icon" />
    <!-- ... -->
    <img *ngSwitchDefault src="/assets/file-types/Empty.svg" alt="File icon" />
  </div>
  <!-- ... -->
  <img *ngSwitchDefault src="/assets/file-types/Empty.svg" alt="File icon" />
</div>

produces the following output

<div>
@switch (mimeTypeCategory) {
  @case ('text') {
  <div [ 
@switch (mimeTypeExtension) {   <i@case ('plain') {
  mg *rc="/assets/file-types/TXT.svg" alt="TXT icon" />
 
}   <!-- ... -->
    <i@default {
  mg *rc="/assets/file-types/Empty.svg" alt="File icon" />
 
} </}
div>
}
  <!-- ... -->
  @default {
  <img src="/assets/file-types/Empty.svg" alt="File icon" />
}
}
</div>

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)

No response

Anything else?

No response

Activity

  1. added
    area: migrations
    on Nov 17, 2023
  2. added this to the needsTriage milestone on Nov 17, 2023
  3. added
    core: control flow
    on Nov 19, 2023
  4. added a commit that references this issue on Nov 20, 2023
    492ad46
  5. angular-automatic-lock-bot commented on Dec 21, 2023

    @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.

  6. locked and limited conversation to collaborators on Dec 21, 2023
  7. added a commit that references this issue on Jan 23, 2024
    d6bac75
  8. added 2 commits that reference this issue on Jan 26, 2024
    28f6cbf
    e31e5fa
  9. added a commit that references this issue on Jan 26, 2024
    d565500
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