title: Failed to instantiate module
body: <p>I have a REST service that I want to use my angular app. I added 2 changes to my code that cause an exception.</p>
  
  <pre><code>[$injector:modulerr] Failed to instantiate module xxx due to:
  Error: [$injector:modulerr] Failed to instantiate module xxx.pages due to:
  Error: [$injector:modulerr] Failed to instantiate module Profile due to:
  Error: [$injector:nomod] Module 'Profile' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
  </code></pre>
  
  <p>services/service.js</p>
  
  <pre><code>angular.module('xxx.services', ['ngResource'])
  .factory('Profile', ['$resource',
    function($resource){
      return $resource('/api/v1/profile', {}, {
        query: { method:'GET' }
      });
    }]);
  </code></pre>
  
  <p>pages/pages.js</p>
  
  <pre><code>angular.module('xxx.pages', ['xxx.grandfather', 'Profile'])
  .config(function ($stateProvider) {
    $stateProvider
      .state('app.admin', {
        url: '/admin',
        templateUrl: 'cmp/pages/admin.tpl.html',
        accessLevel: accessLevels.admin
      })
      .state('app.user', {
        url: '/user',
        templateUrl: 'cmp/pages/user.tpl.html',
        controller: 'UserController',
        accessLevel: accessLevels.user
      });
  })
  .controller('UserController', function ($scope, Profile) {
    $scope.profile = Profile.query();
  });
  </code></pre>
  
  <p>I tired all the google resulsts:</p>
  
  <ul>
  <li>ng-app is there and it was working fine before</li>
  <li>xxx.services.Profile and all combinations</li>
  <li>included angular-route.js</li>
  </ul>