Purpose This skill provides comprehensive guidance on Angular 20's built-in control flow syntax, which introduces new template syntax (@if, @for, @switch, @defer) that replaces structural directives with better performance, type safety, and developer experience.
| Syntax error with @ blocks | Ensure Angular 20+ and update compiler | | @for without track error | Always add track expression to @for | | @defer not lazy loading | Check bundle config and verify component is in separate chunk | | Type errors with @if | Use as alias for type narrowing |
| @empty not showing | Ensure collection signal returns empty array, not undefined |
Встроенный синтаксис потока управления Angular 20 (@if, @for, @switch, @defer) для современного программирования шаблонов. Используйте при написании шаблонов с условным рендерингом, циклами, операторами переключения или отложенной загрузкой компонентов. Заменяет *ngIf, *ngFor, *ngSwitch новым синтаксисом блоков для повышения производительности и безопасности типов. Источник: 7spade/black-tortoise.