0
我有一个问题,我不知道如何解决它。离子1.不起作用HTTP请求
我有$ http.get()在离子和当我做离子服务它的工作完美。但是当我运行ios/android或者我在Ionic View中看到它时,什么都没有发生。
我的服务:
.service('myService', function($rootScope, $http, $q) {
this.all = function() {
var deferred = $q.defer();
$http.get('xxxxxxxxxxxxxxx')
.success(function(data) {
deferred.resolve(data);
})
.error(function(data) {
alert(data);
deferred.reject(data);
});
return deferred.promise;
};
});
在我的控制器:
myService.all().then(function(data) {
$scope.data = data;
});
当我打开一个浏览器,它显示出良好的,并在设备我与“空”的警报。
我做的:
离子更新
安装科尔多瓦 - 插件白名单
离子建立IOS/Android的 - >离子上传/离子运行
地址:
<access origin="*" subdomains="true"/>
<allow-navigation href="http://*/*"/>
in config.xml
但没有任何工作...任何想法?
非常感谢。
看看http://content-security-policy.com/ –
什么:/我不知道是什么去做 – carlos