0
我有一個工作的Angular-Module。當我更改URL(相同的JSON文件)時,它將不起作用。我錯了什麼?
工作模塊:
angular.module('destinationsApp', []).controller('destinationsCtrl', function($scope, $http){
$http
.get('https://raw.githubusercontent.com/MAHUKI-Webdesign/suntrips.github.io/master/main_sub_themes-light.json')
.then(function(itemsResponse) {
$scope.items = itemsResponse.data.main_themes;
不工作:
angular.module('destinationsApp', []).controller('destinationsCtrl', function($scope, $http){
$http
.get('https://www.suntrips.de/import/main_sub_themes-light.json')
.then(function(itemsResponse) {
$scope.items = itemsResponse.data.main_themes;
什麼是響應裏面的itemsResponse? – Sletheren
您在控制檯/網絡選項卡中看到的任何錯誤? – EugenAz
Access-Control-Allow-Origin缺少 –