1

The title may be deceiving, but I do not know what is going on here. Here is my controller setup:

angular.module('myApp.controllers', [])
.controller('AboutCtrl', ['$scope', 'About', function ($scope, About) {
    $scope.about = About.query();
}])

I am getting the angular error: http://docs.angularjs.org/error/$injector/unpr?p0=AboutProvider%20%3C-%20About.

I have this module:

angular.module('myApp.restServices', ['ngResource'])
    .factory('About', ['$resource',
        function ($resource) {
            return $resource(service.about, {});
        }])

What am I missing?

1 Answer 1

1

The answer was pretty simple, when declaring the myApp module, I need to inject the dependancy:

angular.module('myApp', [
    'ngTouch',
    'ngRoute',
    'ngAnimate',
    'myApp.controllers',
    'myApp. restServices'
]).
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.