【发布时间】:2016-02-07 07:28:59
【问题描述】:
以下代码适用于浏览器和 iPhone 5s,但不适用于 iOS 模拟器。我试图弄清楚它是模拟器还是离子中的东西。
我已经在 Info.plist 中设置了 NSAppTransportSecurity 以便能够使用 http
NSAppTransportSecurity NSAllowsArbitraryLoads 和代码:
accountRepo.register($scope.login.registryCode)
.success(function(data){
accountRepo.user = data;
$scope.hideLoading();
$state.go("setPin");
})
.error(function(err){
console.log(err);
$scope.hideLoading();
alert("Incorrect registry code");
});
和回购
app.factory('accountRepo', function($http) {
return {
token: {},
register: function(registryCode) {
return $http.post("http://localhost:9501/register",
{"registryCode": registryCode} );
},
发生错误时,err 参数为空。我在 Xcode 的输出中一无所获。我应该看看别的地方吗?
【问题讨论】:
标签: ios angularjs cordova ionic