The deal with asterisks

The asterisks that precede all the structural directives are very important. The *ngIf and *ngFor directives refuse to work when you remove the asterisks from them, implying that the asterisks are required. The question, therefore, is this: why do the asterisks have to be there?

They are syntactic sugar in Angular, meaning that they don't have to be written this way. This is how they actually look:

<div template="ngIf true">  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nesciunt non perspiciatis consequatur sapiente provident nemo similique. Minus quo veritatis ratione, quaerat dolores optio facilis dolor nemo, tenetur, obcaecati quibusdam, doloremque.</p></div>

This template attribute is, in turn, translated ...

Get TypeScript 2.x for Angular Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.