Hi I just started using AngularJs, I am having issue when using $http to get data and $scope.productInfos = data returns Error: [ngRepeat:dupes], below is my code:
$scope.processForm = function(formData) {
$http({
method : 'POST',
url: '/quote-tool/productinfoforproductids/', // using php to generate json i.e [{id:1},{id:2}]
data: $('.js-checkedCompareForm').serialize(),
headers : { 'Content-Type': 'application/x-www-form-urlencoded' } // set the headers so angular passing info as form data (not request payload)
}).success(function(result) {
$scope.productInfos = result;
}).error(function(err) {
return err;
});
};
in the view:
<div class="js-productInfo" ng-repeat="productInfo in productInfos">
{{ productInfo.id }}
</div>
I am not sure angular see it as a repeated dup? I have been trying using track by $index, but still not working instead, it shows excessive repeats in the view.