user3510767
user3510767

Reputation: 25

ngResource is not working in my project, imported cdn for angularjs version 1.3.14, angular-resource 1.3.14

Injected 'ngResouce', Created factory and used $resource in that. Passed factory name to Controller.

Its giving error

"Error: [$injector:unpr] "

Upvotes: 0

Views: 303

Answers (1)

MechanicalCoder
MechanicalCoder

Reputation: 286

can you provide more details around your query, i see you have mentioned $resource.

$resource is a factory which creates a resource object that lets you interact with RESTful server-side data sources.

from your question its not clear how you are injecting the resource, if you are defining a module you may try this

angular.module('app', ['ngResource']);

and for creating a factory you may try the below code,

angular.module('app', ['ngResource']) 
.factory('myfactory', function($resource){ 
// your code here 
});

Upvotes: 1

Related Questions