【发布时间】:2017-04-23 07:13:35
【问题描述】:
这是我的代码: 问题角度加载资源失败:服务器响应状态为 404(未找到)
app.controller("allFarmerCtrl",function($scope,$http){
$scope.perPage = "50";
$scope.allFarmers = [];
$scope.reverse = false;
var where = {
table : "farmer"
};
$http({
method : "POST",
url : url + "read",
data : where
}).success(function(response){
if(response.length>0){
angular.forEach(response,function(values , index){
values['sl'] = index+1;
$scope.allFarmers.push(values);
});
}else{
$scope.allFarmers = [];
}
console.log($scope.allFarmers);
});
});
【问题讨论】:
-
您的网址可能不正确。交叉检查您的网址、请求方法类型。如果这可行,也试试
url : url + "read"
标签: angularjs