Loading topic
*ngIf, *ngFor, and ngSwitch. Since Angular 17, the template syntax itself has built-in control flow blocks: `2 min read@if block, which the previous chapter co3 min read@if expression in a named variable and use it inside the block.3 min readtasks(). The @for block repeats a piece of template once for each item in a collection. It replaces *ngFor and needs no 2 min readtrack expression that every @for block requires: what it does, how to pick one, and which mistakes to avoid.3 min read@for and track work. Here you will learn the six variables that @for provides inside its block and how to use them.2 min read@empty block that you attach to an @for block. It assumes you know TypeScript, Angular components and templates, and property binding. It also assumes you have seen @for with a track expression. Signals are helpful but not required.3 min read@switch, which picks one of several templates by comparing a value against fixed cases.3 min readif (x !== null)). It also assumes you have read the earlier chapters on @if and aliases, and that your project enables strictTemplates in tsconfig.json:2 min read@if, @for, and @switch inside each other. It assumes you know basic TypeScript, Angular components and templates, and the syntax of each block from the earlier chapters. Signals are used in the examples, but observables work the same way.3 min read@if, @for, and @switch at a basic level. It covers the errors that show up most often and how to fix each one.3 min read@if, @for, and @switch. You will convert a template by hand, then use the Angular CLI schematic to do it across a project.2 min read