Example *ngFor Code How To Loop An Array Object In Angular 2
- Forums
- Angular
- Example *ngFor Code How To Loop An Array Object In Angular 2
this page will show you the syntax code you will need to loop through an array object in angular 2 framework [4630], Last Updated: Mon Jun 24, 2024
Angular2
Fri Jan 27, 2017
0 Comments
420 Visits
looping is very common in progamming, in angular this is how you would loop though an array with objects:
you can put this in your template code for example, you can use this HTML code:
<li *ngFor="let carPart of carParts">
<h2> {{carPart.name}}</h2>
<p>{{carPart.description}}</p>
<p>{{carPart.inStock}} In Stock </p>
</li>
i hope this helps you to try to understand the format you need to iterate a loop in angular 2 using typscript and es2015 script. on the above example, i was using angular quickstart to show you how i can do this loop.
i dont know what else because the syntax is pretty straight forward, nothing complicated once you know how to do it.
thats all