$scope.timelines = [];$scope.timelines = response["data"];angular.forEach(response["data"], function(obj) {$scope.timelines.push(obj);});cs Angular js notify that you have duplicate dataDuplicate keys are banned because Angular js uses keys to associate DOM nodes with item.I was so surprised with error link siteIt explained you can solve your mistake in detail.first show Error Descriptionsecond display solution.Description
Occurs if there are duplicate keys in an ngRepeat expression. Duplicate keys are banned because AngularJS uses keys to associate DOM nodes with items.By default, collections are keyed by reference which is desirable for most common models but can be problematic for primitive types that are interned (share references).For example the issue can be triggered by this invalid code:<div ng-repeat="value in [4, 4]"></div>
To resolve this error either ensure that the items in the collection have unique identity or use thetrack by
syntax to specify how to track the association between models and DOM.The example above can be resolved by usingtrack by $index
, which will cause the items to be keyed by their position in the array instead of their value:<div ng-repeat="value in [4, 4] track by $index"></div>
but I solve other way to reject the duplicate data
전체 페이지뷰
2016년 1월 27일 수요일
angular js error page
I don't know that I push the duplicate data in angular js
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기