2
votes

This is my code: Problem angular Failed to load resource: the server responded with a status of 404 (Not Found)

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);
  });
});
1
your url might not be correct. Cross check your url, request method type. Also try if this works url : url + "read"Abdullah Khan

1 Answers

0
votes

if you are using live server extensions, you can solve it by putting a / after the url it created in your browser. for example you can modify index.html to index.html/