Skip to content Skip to sidebar Skip to footer

Ng -repeat Repeating Data With Duplicate Entries

I'm trying to display a JSON data using AngularJS ng repeat but the records are getting duplicated. Note: It works fine the very first time the page is loaded. When I try to reloa

Solution 1:

Not sure what your case is, but following code will do the trick for you

If you would be able to refactor index i.e id to your json object, you can use track by syntax for the same.

<trng-repeat="point in employeePoints track by point.id"><td><spanclass="name">{{point.EmployeeName}}</span></td><tdclass="hidden-phone">
        {{point.Points}}
    </td></tr>

can do

ng-repeat="point in employeePoints track by $index"

It would be better to use your actual data ids instead you can use angularjs $index for the same in case if you would not be able to fetch ids.

Post a Comment for "Ng -repeat Repeating Data With Duplicate Entries"