Angular Template Syntax and Control Flow

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/25

flashcard set

Earn XP

Description and Tags

Flashcards covering Angular v17+ Template Syntax, including @if, @for, @switch, @let, and @defer control flow mechanisms.

Last updated 10:17 AM on 7/21/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

26 Terms

1
New cards

@if

The Angular control flow syntax that replaced *ngIf for conditional rendering.

2
New cards

@else / @else if

The new control flow syntax used within @if blocks to handle alternative conditions.

3
New cards

@for

The Angular control flow syntax that replaced *ngFor, used for iterating over arrays or any iterables.

4
New cards

track

A required property in the @for syntax used to provide a stable DOM identity for items, leading to fewer re-renders.

5
New cards

indexindex

A context variable representing the current item index; only acceptable in track for static lists.

6
New cards

@empty

A specific block within @for that displays fallback content when the iterable contains no items.

7
New cards

@switch

The control flow syntax replacing *ngSwitch, which handles multiple cases without needing break statements.

8
New cards

@case

The block used inside @switch to match specific expression values; it does not support fall through.

9
New cards

@default

The fallback block used within @switch when no @case matches the provided expression.

10
New cards

@let

A syntax used to create a local, non-reassignable template variable whose scope is restricted to the current template block.

11
New cards

@defer

A control flow block used to lazy-load template content, including standalone components and dependencies, to improve initial load speed.

12
New cards

Browser idle

The default trigger for the @defer block.

13
New cards

on viewport

A @defer trigger that initiates loading when the content enters the browser viewport.

14
New cards

on hover

A @defer trigger that initiates loading when a user hovers over the designated area.

15
New cards

on interaction

A @defer trigger that initiates loading when a user interacts with the content, such as through a click.

16
New cards

on timer(5s5\,s)

A @defer trigger that initiates loading after a specified duration, such as 5s5\,s.

17
New cards

when [condition]

An immediate @defer trigger that activates once a specified condition evaluates to true.

18
New cards

@placeholder

A block displayed before the loading of deferred content begins.

19
New cards

@loading

A block displayed during the time that the deferred content is being loaded.

20
New cards

@error

A block displayed if the loading process for deferred content fails.

21
New cards

Angular 1717

The version of Angular that introduced the new @ symbol-based control flow compiler syntax.

22
New cards

Context Variables

Variables available within @for blocks including $index\$index, $count\$count, $first\$first, $last\$last, $even\$even, and $odd\$odd.

23
New cards

prefetch

An option in the @defer syntax that allows resources to be downloaded before the content is rendered.

24
New cards

hydrate

An option used with @defer blocks to improve Server-Side Rendering (SSR) hydration.

25
New cards

@if(expr; as value)

The syntax for capturing the result of a conditional expression into a local variable within an @if block.

26
New cards

track item.id

The recommended practice for the @for track property, utilizing a unique stable primitive key.