AngularJS ng-repeat duplicated error, when search is fired -


i have listing using ng-repeat search 2 available parameters (month , state).

if make search, ng-repeat error found duplicates.

can not understand why if in both cases json data have same structure (just values change).

i have these ng-repeats: item in data , nested inside : uniqueitem in item

i've tried use track $index loops every single character, , item.index or item.label1 triggers found duplicates erros again.

here loop using ng-repeat.

<tbody ng-repeat="item in data">      <tr ng-repeat="uniqueitem in item">         <td>            {{uniqueitem.label1 | number}}          </td>         <td>            {{uniqueitem.label2 | number}}          </td> 

my json has structure :

[   {     "index": 0,     "label1": "initials",     "label2": "2",     "label3": "18",     "label4": "12",     "label5": 150,     "label6": "30",     "label7": 60,     "label5a": "v",     "label7a": "r"   },   {     "index": 1,     "label1": "others",     "label2": 5485,     "label3": 27289,     "label4": 37776,     "label5": 72.23,     "label6": 91949,     "label7": 29.67,     "label5a": "r",     "label7a": "r"   },   ....   ] 

just works !

  1. inside $http.post(apiendpoint.url,$scope.formdata).success(function(data) {

  2. instead of line : $scope.data = json.stringify(data);

  3. i add these lines :

    var acp = {}; acp.resultdata = [ data ]; $scope.data = acp.resultdata;

i replicate in plunkr, can not why json.stringify causes behavior.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -