While I was answering another question, I saw a screenshot of a book that states that *ngFor (syntactic sugar version) is made of two structural directives.
This is the code shown in the book:
<ul>
<li *ngFor="let book of books">
{{book.title}}
</li>
</ul>
So either the Angular guide is wrong when it states that "Structural directives are easy to recognize. An asterisk (*) precedes the directive attribute name...". Or the book is wrong. Because I see only one asterisk there.
So I started digging in the ngFor docs of Angular. And I've found this:
From this screenshot, it seems that the author of the book is right, that [ngFor] and [ngForOf] are both (structural) directives.
So now I am thinking about this scenario. Maybe it's like two (structural) directives:
- the first one that is responsible for copying the entire HTML element and place inside the ng-template tag (since in Angular you can only use one structural directive for each element)
- the second that is responsible for copying the element inside ng-template as many time as it needs to be iterated and hydrating the elements with the required data
This is a screenshot of the book that I am talking about:

I am sorry, but I don't have any details myself about the name of the book or the author (as they are not included by the original author of the question).
