1. 程式人生 > >Angular http跨域

Angular http跨域

lencod cti ces gpo success ont nco lar name

var app = angular.module(‘Mywind‘,[‘ui.router‘]);

app.controller(‘Myautumn‘,function($scope,$http,$filter){

  

//$http跨域
//服務端設置
  // 訪問權限 response.setHeader("Access-Control-Allow-Origin", "*");
  // 訪問類型 response.setHeader("Access-Control-Allow-Methods","POST");
  // 響應頭 response.setHeader("Access-Control-Allow-Headers","x-requested-with,content-type");
  // $http.post(
    // ‘url‘,
    // {languageColumn:‘name_eu‘},
    // {‘Content-Type‘:‘application/x-www-form-urlencoded‘}).success(function(data){
    // $scope.industries = data;
  // });

});

Angular http跨域