Skip to content
masterclass Buddy

Angular · Directive

@if

@if conditionally renders template content when its condition is truthy. It also supports @else if, @else, and local names for expression results.

Last updated

Syntax

@if (condition) { ... } @else if (otherCondition) { ... } @else { ... }

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • @else if
  • @else

Source: @if • Angular. Checked 2026-11-03.