我有一个cUrl
,我想在angularjs中使用JSON
数据但是它给了我错误
"错误:$ sce:insecurl
处理来自不受信任来源的资源被阻止"
代码:
var App = angular.module('App', [ ]);
App.config(['$sceDelegateProvider', function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
'self',
'http://125.99.157.180/suez/dispweigh.php',
]);
}]);
App.controller('AboutCtrl', function ($scope, $http, $sce){
var url = $sce.trustAsResourceUrl('http://125.99.157.180/suez/dispweigh.php');
$http.get(url)
.then(function (data) {
$scope.result = data;
});
});