我正在使用以下内容:
var url = '/api/Test/Mark';
$http('POST', url, $scope.content.answers)
.success(function (data, status, headers, config) {
$scope.content = data.text;
})
.error(function (data, status, headers, config) {
alert("Error: No data returned from " + url);
});
当我尝试调用它时,这给了我一个错误:
TypeError: Cannot use 'in' operator to search for '3' in POST
at isArrayLike (http://127.0.0.1:81/Scripts/angular-v1.2.0-rc.2.js:183:81)
at forEach (http://127.0.0.1:81/Scripts/angular-v1.2.0-rc.2.js:225:16)
at http://127.0.0.1:81/Scripts/angular-v1.2.0-rc.2.js:329:7
at forEach (http://127.0.0.1:81/Scripts/angular-v1.2.0-rc.2.js:227:18)
at extend (http://127.0.0.1:81/Scripts/angular-v1.2.0-rc.2.js:327:3)
at $http (http://127.0.0.1:81/Scripts/angular-v1.2.0-rc.2.js:6256:7)
at Scope.$scope.markQuestion (http://127.0.0.1:81/Content/app/questions/controllers/content.js:39:13)
at elementFns (http://127.0.0.1:81/Scripts/angular-v1.2.0-rc.2.js:8564:19)
at http://127.0.0.1:81/Scripts/angular-v1.2.0-rc.2.js:15511:13
at Scope.$get.Scope.$eval (http://127.0.0.1:81/Scripts/angular-v1.2.0-rc.2.js:10034:28)
有人可以就我可能做错的事情给我建议吗?注意 $scope.content.answers 是一个数据数组。