$http.post works in browser and on hardware but not in emulator


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


and the code:

        accountRepo.user = data;
        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?