Ich mache eine App mit AngularJS.
Plötzlich habe ich diesen Fehler bekommen.
Error: [$rootScope:infdig] http://errors.angularjs.org/1.6.4/ $rootScope/infdig?p0=10&p1=%5B%5D
Siehe mein Code:
HTML:
<body ng-app="invApp" ng-controller="InvoiceController as ctrl">
<span ng-repeat="code in ctrl.codes">{{ getProduct(code) }}</span>
</body>
JS:
var app = angular.module("invApp", []);
app.controller("InvoiceController", function ($scope, $http) {
$scope.codes = ["KKS", "KKB", "SNS"];
$scope.getProduct = function (code) {
$http({
method: 'GET',
url: '../api?action=getproduct&code='+code
}).then(function successCallback(response) {
var something = response.data;
});
return something;
};
});
Was Code und warum Sie ist sind returning data2 – ukn