上QQ阅读APP看书,第一时间看更新
Null guarding in Angular
In JavaScript, the undefined and null values are a persistent issue that must be proactively dealt with every step of the way. There are multiple ways to guard against null values in Angular:
- Property Initialization
- Safe Navigation Operator ?.
- Null Guarding with *ngIf