Empty view when using ngResource

I create a factory like this:

angular.module('todoApp', ['ngResource']).factory('taskService', ['constantsService', function($resource, constantsService){
var serverUrl = constantsService.server_url;
return {
    add: function(task){ $resource(serverUrl + '/api/task/', {task: task}, {'query':  {method:'POST'}});}
}
}]);

When I add ngResource to my module, I get an empty html element instead of my application.

+5
source share
1 answer

I add ngResource to my module when I create it, and not to the factory, and it works.

0
source

All Articles