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:

  1. Property Initialization
  2. Safe Navigation Operator ?.
  3. Null Guarding with *ngIf

Get Angular 6 for Enterprise-Ready Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.