$resource get not executing in simulator


#1

I have a $resource call which when run from the browser with the python server works fine but when in the simulator it does not execute.

$scope.login = $resource('http://fv-host:9381/fv/User/:action',
            {action:'login',
                id:'@id',
                password:'@password',
                remember:'false',
                callback:'JSON_CALLBACK'},
            {get:{method:'POST'}}
        );
called via 
$scope.doLogin = function(uName, pWord) {
          $scope.loginResult = $scope.login.get({action:'login', id:mID, password:mPword, remember:'false', callback:'JSON_CALLBACK'});
}

I display loginResult as {{loginResult}} after calling doLogin() loginResult shows the {action:…} with the params mID and mPword replaced by the values passed in.

My service never receives anything from the client.

is there a difference in the way $scope works in the simulator or is $resource/ngResource not available with the simulator.

Any advice appreciated.


#2

Are you getting any error in your console?


#3

No errors in the console or anywhere else


#4

Is it on an iOS device and do you have the $sceProvider set up to allow external sources?


#5

I’m using the IOS simulator

and I have passed $sce in on the controller signature

.controller(‘AccountCtrl’, function($scope, $resource, $sce){

I have not done anything specific to configure $sce


#6

I have not had to use sce to call $resource when the ap is deployed to a web server.

Only when I am setting a URL on an iFrame to display content.


#7

Could you post a codepen with a sample data? It’s kind of hard to figure out what the issue is with out being able to poke around.


#8

Did anything ever get posted for this? My $resource requests are getting blocked when using $resource, but it works when using $http. Have no idea why?