Skip to content

feat(compiler): Add support for multiple swich cases matching#66210

Merged
kirjs merged 1 commit intoangular:mainfrom
JeanMeche:multiple-case
Jan 7, 2026
Merged

feat(compiler): Add support for multiple swich cases matching#66210
kirjs merged 1 commit intoangular:mainfrom
JeanMeche:multiple-case

Conversation

@JeanMeche
Copy link
Member

@JeanMeche JeanMeche commented Dec 20, 2025

Happy Hollidays & Merry Christmas 🎅🏻 🎄

Consecutive @case blocks are now supported:

@switch (case) {
  @case (0)
  @case (1) {
    <div>case 0 or 1</div>
  }
  @case (2) {
    <div>case 2</div>
  }
  @default {
    <div>default</div>
  }
}

fixes #14659

@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: compiler Issues related to `ngc`, Angular's template compiler labels Dec 20, 2025
@ngbot ngbot bot added this to the Backlog milestone Dec 20, 2025
@JeanMeche JeanMeche force-pushed the multiple-case branch 5 times, most recently from 1540e9a to 35b358c Compare December 20, 2025 16:21
Copy link
Contributor

@atscott atscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to make sure you update the textmate scopes for syntax highlighting

@JeanMeche JeanMeche force-pushed the multiple-case branch 11 times, most recently from 7967458 to 23e9ad0 Compare December 21, 2025 17:11
@JeanMeche JeanMeche changed the title feat(compiler): Add support for multiple swich cases matching WIP feat(compiler): Add support for multiple swich cases matching Dec 21, 2025
@JeanMeche JeanMeche marked this pull request as ready for review December 21, 2025 17:17
@pullapprove pullapprove bot requested a review from devversion December 21, 2025 17:17
@JeanMeche JeanMeche requested review from atscott and crisbeto and removed request for devversion December 21, 2025 17:17
@pullapprove pullapprove bot requested a review from devversion December 21, 2025 17:17
@JeanMeche JeanMeche force-pushed the multiple-case branch 2 times, most recently from 48f2cee to 90fc992 Compare December 21, 2025 21:16
@JeanMeche JeanMeche force-pushed the multiple-case branch 6 times, most recently from 0e8befb to ecbc363 Compare December 23, 2025 10:05
@JeanMeche JeanMeche marked this pull request as ready for review December 23, 2025 10:05
@JeanMeche JeanMeche requested review from crisbeto and removed request for devversion January 2, 2026 10:56
@pullapprove pullapprove bot requested a review from devversion January 2, 2026 10:57
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for dev-infra

@JeanMeche will you put up some docs for this? Nice feature!

@JeanMeche JeanMeche force-pushed the multiple-case branch 3 times, most recently from 17053b5 to 1f97322 Compare January 6, 2026 20:05
Copy link
Contributor

@atscott atscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 6, 2026
consecutive `@case` blocks are now supported:

```ts
@switch (case) {
  @case (0)
  @case (1) {
    case 0 or 1
  }
  @case (2) {
    case 2
  }
  @default {
    default
  }
}
```

fixes angular#14659
@kirjs kirjs merged commit 640693d into angular:main Jan 7, 2026
18 checks passed
@kirjs
Copy link
Contributor

kirjs commented Jan 7, 2026

This PR was merged into the repository. The changes were merged into the following branches:

@JeanMeche JeanMeche deleted the multiple-case branch January 7, 2026 16:00
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: support multiple case matching in ngSwitch/@switch

5 participants