# @if and @for

@if shows part of a template only when a condition is true, with @else for the other case. @for repeats part of a template for each item of a list, with track to tell the items apart, and @empty for an empty list.

![Cheat sheet: @if and @for](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/a9590eae0a6a4e46a479232bcf801eb4.webp)

- Category: Angular
- Level: Apprentice
- Tags: @for, @if, angular
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/binding-and-events-in-angular-if-and-for-cheat-sheet
