*ngFor and *ngIf control DOM structure; always track by stable keys.
Import [Ng.CommonModule] in standalone @Component when using *ngIf or *ngFor.
Important interview questions and answers
- Q: Why does this matter?
A: *ngFor and *ngIf control DOM structure; always track by stable keys.
Self-check
- Summarize Structural directives in one sentence.
- What would you try next in the playground?
Challenge
Structural directives hands-on
- Edit the default code.
- Click Run in browser.
- Confirm preview or terminal output.
Done when: preview or terminal matches the lesson goal.
Pitfall: Import CommonModule in standalone components before using *ngIf or *ngFor.