1
這是我的腳本。
var rtsTaxi = angular.module("rtsTaxi",['ngAnimate', 'ui.bootstrap']);\
rtsTaxi.config(['$httpProvider',function($httpProdvider)
{
$httpProvider.defaults.headers.post['Content-Type'] = 'application/json;charset=utf-8';
$httpProdvider.defaults.useXDomain = true;
delete $httpProdvider.defaults.headers.common['X-Requested-With'];
}]);
rtsTaxi.controller("bookingController",function($scope){
var message ="Success";
$scope.bookNow = function()
{
$http({
method : 'POST',
url: 'request-url',
data: {messages : message},
header : { 'Content-Type' : 'application/json; charset-utf-8'}
});
};
當我運行我的應用程序時,Chrome控制檯給我一個$ httpProvider引用錯誤。我在StackOverflow上嘗試過其他解決方案,但還是我有問題