DEV Community

Dionis Dimcea
Dionis Dimcea

Posted on

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)