我的Angular应用程序中有一个本地JSON文件,效果很好。当我将该文件上传到我的服务器并尝试访问它时,数据将无法读取。需要改变什么?
.controller('ListController', ['$scope', '$http', '$state', function($scope, $http, $state) {
$http.get('http://example.com/remoteproducts.json').success(function(data) {
$scope.products = data;
$scope.whichproduct = $state.params.aId;
});
}]);
答案 0 :(得分:0)
此代码现在可以使用
use strict;
use warnings;
my $filename = ""; # enter your filename
open FH, $filename or die "Error\n";
my @array = <FH>;
my @values = map /(\d+)/, @array;
my @indices = sort { $values[$a] <=> $values[$b] } 0 .. $#values;
print "$array[$_]\n" for @indices;
可在安装此Chrome扩展程序后在浏览器中查看