Use Modern Angular Template APIs
Use the current Angular idiom over the legacy one it replaced. One legacy usage that surfaces is the start of a sweep (Code Review Compounds Into Patterns And Sweeps).
Why
The code follows where the framework is going.
How To Apply
- Use
@if,@forand@switchover*ngIf,*ngForand[ngSwitch]. - Use
input()andoutput()over@Input()and@Output(), andmodel()over an@Input()and@Output()pair for two-way binding. - Use the signal queries
viewChild(),viewChildren(),contentChild()andcontentChildren()over their decorator forms.