What are the types of loops that exist in Angular 2?
I could only find for
and foreach
, but it's hard for me to find others. Is there a list somewhere?
Are there any examples anywhere? This will help in understanding very much.
[EDIT]: Basically, I am looking for a list of all types of loops in Angular 2.
[EDIT 2]: I really mean the loops specific to Angular 2 in the template section (Sorry, I didn't know there were so many possibilities). To give an example using * ngFor:
<ul class="contacts"> <li *ngFor="#contact of contacts" (click)="onSelectContact(contact)" [class.selectedContact]="contact === selectedContact"> <span class="badge">{{contact.id}}</span> {{contact.name}} </li> </ul>
source share