angularjs - CROSS requests and ng-repeate -


i'd decompose java ee web application 2 parts, server contains web services , made in spring framework, , client contains client interfaces made in angular js.

the 2 apps have different domaines, first problem request angular in client rejected. solution found in stackoverflow have enable cross requests in server , use cross requests in client. processed way, , request reached server succesfully.

the problem i'm using ng-repeat show list that's web service, list contains correct data when check console.log . ng-repeat tag not working, , when i'm refreshing page, error appearing in console :

angular.js:14328 error: [ngrepeat:dupes] duplicates in repeater not allowed. use 'track by' expression specify unique keys. repeater: lcat in listecategories track lcat.idcategorie, duplicate key: undefined, duplicate value: { http://errors.angularjs.org/1.6.1/ngrepeat/dupes?p0=lcat%20in%20listecategories%20track%20by%20lcat.idcategorie&p1=undefined&p2=%7b     @ angular.js:68     @ ngrepeataction (angular.js:30804)     @ $watchcollectionaction (angular.js:17677)     @ scope.$digest (angular.js:17814)     @ angular.js:18011     @ completeoutstandingrequest (angular.js:6111)     @ angular.js:6390 

what think?

you need add track $index avoid duplicates while repeat.

https://docs.angularjs.org/api/ng/directive/ngrepeat


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -