'use strict';
foodMeApp.controller('SearchController', function($scope, $http) {
$scope.url = '/server/api.php'; // The url of our search, some thing wrong here
// The function that will be executed on button click (ng-click="search()")
$scope.search = function() {
// Create the http post request
// the data holds the keywords
// The request is a JSON request.
$http.post($scope.url, { "data" : $scope.keywords}).
success(function(data, status) {
...
}).error(function(data, status) {
...
});
};
});
這裏有什麼錯誤$ scope.url ='/server/api.php';
粘貼了目錄結構和錯誤,
瀏覽器錯誤:
請讓我知道,如果需要更多的信息
我想,你的服務器文件夾是不確定的,看到該文件夾 –
在一些通知符號嘗試$ scope.url = '服務器/ api.php'; – BKM