Follow-up · depth 2
What are common failure modes of Built-in Control Flow @if @for @switch?
What are common failure modes of Built-in Control Flow @if @for @switch?
Answers use simple, clear English.
Quick interview answer
Common failures around Built-in Control Flow @if @for @switch: blocking the hot path, ignoring backpressure, and weak timeout/retry design. Using index as track for reorderable lists.
Detailed answer
Failure modes for Built-in Control Flow @if @for @switch: Known pitfalls: Using index as track for reorderable lists. • Missing timeouts / unbounded retries • No backpressure when downstream slows • Assuming ordering/guarantees the runtime does not provide How seniors prevent them: Always track by identity; prefer new syntax in Angular 17+. Parent context: Pros: Clearer templates; forces track for lists. Cons: Muscle memory of structural directives.
Full explanation
Name concrete failure modes and the mitigation for each — that scores higher than a vague “it can fail.” New template syntax replaces *ngIf/*ngFor for many cases: @if, @for (with track), @switch. Better type narrowing and performance guidance via mandatory track.
Follow-up questions
Only answered follow-ups are shown — click to open with full answers
Parent context — Built-in Control Flow @if @for @switch
Pros: Clearer templates; forces track for lists. Cons: Muscle memory of structural directives.
View full parent question →