DEV Community

Dionis Dimcea
Dionis Dimcea

Posted on

Angular @if

Angular has released the new '@if' block syntax inspired by Javascript

How does this work?

@if

Similar to JavaScript's if statement, Angular uses @if to conditionally hide and show part of a template and its contents

Angular ngIf alternative
@else

When you need a fallback, similar to JavaScript's else clause, add an @else block to accomplish the same effect

Angular ngIf else alternative

Angular docs

Top comments (0)