Advanced AngularLesson 30Free preview
Angular Control Flow
This lesson is part of Angular · All levels
Summary
The new Angular flow control syntax uses the easily-read @if, @for, @switch, and @defer blocks directly in the template. @defer allows certain sections to load lazily according to certain conditions such as viewports or user interactions. This feature replaces the old micro-syntax pattern with more explicit writing.
Key points
- @if, @else if, @else deals with the condition branch
- @for repeating the collection with the @empty block
- @switch is suitable for fixed value matching
- @defer delayed rendering the heavy part until the condition was met
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.