DEV Community

Dionis Dimcea
Dionis Dimcea

Posted on

1

Angular @switch

Angular has released the new '@switch' block syntax similar to Javascript

How does this work?
Angular ngSwitch Alternative

  • The @switch blocks displays content selected by one of the cases matching against the conditional expression

  • The @default block is optional and can be omitted. If no @case matches the expression and there is no @default block, nothing is shown

  • @switch does not have fallthrough, so you do not need an equivalent to a break or return statement.

Angular docs

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay