我正在將flickr應用程序整合到我的應用程序中。 我收到下面的錯誤:訪問控制允許Origin | AngularJS
的XMLHttpRequest無法加載https://api/flickr.com/services/rest?api_key=4cd95b5ad05844319ee958bf96ec0150&format=json&method=flickr.photos.search&nojsoncallback=1。請求的資源上沒有「Access-Control-Allow-Origin」標題。因此不允許訪問原產地'http://sinch12j12.ads.autodesk.com'。響應有HTTP狀態代碼400
下面是客戶端代碼:
(function() {
'use strict';
angular.module('flickrApp', ['ngMaterial'])
.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}])
.controller('ListController', ['$scope', '$http', function($scope, $http) {
$scope.results = [];
$scope.search = function() {
$http({
method: 'GET',
url: 'https://api/flickr.com/services/rest',
params: {
method: 'flickr.photos.search',
api_key: '4cd95b5ad05844319ee958bf96ec0150',
text: $scope.searchTerm,
format: 'json',
nojsoncallback: 1
}
}).success(function(data) {
$scope.results = data;
}).error(function(error) {
console.log(error);
});
}
}]);
})();
請讓我知道如何將可以解決?