I am using ngResource and $resource instead of $http in my project. When I switched over to $resource, I received an $injector:unpr error when I ran the program. I checked to make sure that everything was spelled right. Additionally, I made sure that I called it in the HTML.
Here is the module:
angular.module('confusionApp', ['ui.router', 'ngResource'])
Here is the service I am trying to use:
angular.module('confusionApp')
.constant("baseURL","http://localhost:3000/")
.service('menuService', ['$resource', 'baseURL', function($resource, baseURL) {
this.getDishes = function() {
return $resource(baseURL+"dishes/:id", null, {
'update':{
method:'PUT'
}
});
};
Here is where I call the function:
angular.module('confusionApp')
.controller('MenuController', ['$scope', 'menuService', function($scope, menuService) {
$scope.showMenu = true;
$scope.message = "Loading ...";
$scope.dishes = menuService.getDishes().query();
Here is the HTML scripts:
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
<script src="../bower_components/angular-resource/angular-resource.min.js"></script>
Any help is greatly appreciated.