*ng-for

Angular 2 *ng-for loop

Hello everyone, I am going to share the code sample for *ng-for, ng-repeat in Angular 2 or we can say that how to use *ng-for, ng-repeat in Angular 2.

In Angular 2, ng-repeat is equals to  *ng-for="#user of users".


<div *ng-for="#user of users"> </div>

Example code as given below

<div>
    <h2>Angular 2 *ng-for </h2>

    <div *ng-for="#user of users">
        <div>{{user.ID}}</div>
        <div>{{user.Name}}</div>
        <div>{{user.Date}}</div>
        <div class="pencil" id="{{user.ID}}">
            <a href="~/editUser.html">Update User</a>
        </div>
    </div>
</div>



ANIL SINGH

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Google Amazon and Flipkart Book Store!

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.
ASK Questions
SQL Server NodeJs TypeScript JavaScript Angular SQL Server My Book