Safe Navigation Operator

  • Denoted by a question mark immediately followed by a period e.g. ?.
  • If you reference a property in your template that does not exist, you will throw an exception.
  • The safe navigation operator is a simple, easy way to guard against null and undefined properties.
<!-- No hero, no problem! -->
<h2>The null hero's name is {{nullHero?.firstName}}</h2