title: angular inject using route's resolve data
body: <p>In my routeProvider, I am using a <code>resolve</code> option (<code>user</code>) to fetch user data:</p>
  
  <pre><code>// route.js
  $routeProvider
      .when('/view', {
          templateUrl: 'home.html',
          controller: 'ViewController',
          resolve: {
              user: getUser // some promise that resolves a user object
          }
      });
  
  &lt;body ng-app="app"&gt;
      &lt;nav ng-controller="NavController"&gt;&lt;/nav&gt;
      &lt;main ng-view=""&gt;
          {{user | json}}
      &lt;/main&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>This works just fine when I pass <code>user</code> into my route Controllers.</p>
  
  <p>But, the <code>&lt;nav&gt;</code> html throws an error, I assume since it's not located inside that <code>ng-view</code> tag</p>
  
  <pre><code>// Controller.js
  angular.module('Controllers', [])
      .controller('NavController', ['$scope', 'user', function($scope, user){
          $scope.user = user; // broken!
      })
      .controller('ViewController', ['$scope', 'user', function($scope, user){
          $scope.user = user; // works!
      });
  </code></pre>
  
  <blockquote>
    <p>Error: [$injector:unpr] Unknown provider: userProvider &lt;- user &lt;- NavController</p>
  </blockquote>
  
  <p>Does anyone know of a way I can get the resolved data (<code>user</code>) into an "outside" controller, like the navigation, for example?</p>