Hello,
The code below works in browser and on iPhone 5s but not in the iOS emulator. I’m trying to figure out if it’s the emulator or something in ionic.
I have set the NSAppTransportSecurity in the Info.plist to be able to use http
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
and the code:
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");
});
and the repo
app.factory('accountRepo', function($http) {
return {
token: {},
register: function(registryCode) {
return $http.post("http://localhost:9501/register",
{"registryCode": registryCode} );
},
The err parameter is null when the error occurs. I get nothing in the output in Xcode. Should I look somewhere else?
/J