...

/

The Built-in `NgSwitch` Directive

The Built-in `NgSwitch` Directive

Let’s learn about `NgSwitch`, a built-in attribute directive.

The NgSwitch structural directive provides another well-known switch keyword to the HTML world. We can treat it as an extension of the NgIf directive, which helps consider multiple cases.

The NgSwitch syntax

The NgSwitch syntax is very similar to switch syntax from other languages. So, we have a ...