Error: Unknown provider: $resourceProvider <- $resource <- myservice AngularJS services Error: Unknown provider: $resourceProvider <- $resource <- myservice AngularJS services angularjs angularjs

Error: Unknown provider: $resourceProvider <- $resource <- myservice AngularJS services


You have to include angular-resource.js file and load ngResource module: angular.module('app', ['ngResource'])

For more details check "Installation" section inside the documentation for the $resource service: http://docs.angularjs.org/api/ngResource.$resource


The service module also require the resource.

 angular.module('myApp.services',[])

should be

 angular.module('myApp.services',['ngResource'])

and also the controller needs to know about your service-module

angular.module('myApp.controllers', [])

to

angular.module('myApp.controllers', ['myApp.services','myApp.filters', 'myApp.directives'])

and techincally, your motherModule does not require myApp.services only the myApp.controllers

angular.module('myApp', ['myApp.services','myApp.filters', 'myApp.directives' 'myApp.controllers']).  

to

angular.module('myApp', ['myApp.controllers']).