October 2017
Intermediate to advanced
280 pages
6h 50m
English
The ngFor directive allows us to loop over a collection of items and not only does exactly what ng-repeat does in AngularJS, but also brings some extra semantics. Notice that the ngForOf attribute is surrounded by brackets. At first, these brackets may seem like invalid HTML. However, according to the HTML specification, their use is permitted in attribute names. The only thing the W3C validator will complain about is the fact that the ng-template element doesn't own such attributes; however, browsers won't have problems processing the markup.
The semantics behind these brackets is that the value of the attribute surrounded by them is an expression, which needs to be evaluated.
Read now
Unlock full access