title: Angular: How to access resolved values in UI-Router in controller
body: <p>I cannot access keys that are resolved in my ui-router state in the controller</p>
  
  <p>Currently in a child-state before displaying the template a http request is made to check if user is authenticated. If not, in the onEnter part it redirects to another state.</p>
  
  <p>That works but I also want to access resolved data in the view dispayed
  I don't know how to access the resolved key in the controller (to assign it to a scope property) or directly in the view (which should be posible with the $scope.$resolve introduced in angular 1.5.0).
  I tried injecting the controller with the key, the @resolve property etc. All working examples so far I got when googling this issue did not work for me.</p>
  
  <p>This is the state:</p>
  
  <pre><code>.state('login.resetPassword',{
      url: '/resetPassword/{validateToken}'
      ,resolve: {
          validateResponse: function($stateParams,AuthService,SessionService){
                              return AuthService.validatePasswordResetToken($stateParams.validateToken)
                              .then(function(validateResponse){
                                  SessionService.set('validateToken',$stateParams.validateToken);
                                  return validateResponse.data; //{validate_ok:true/false,message:I18nKey}
                              })
          }
      }
      ,onEnter: function($stateParams,$state,validateResponse){
          if(validateResponse.validate_ok){
              // do nothing, go to resetPassword
          }
          else{
              $state.go('message',{message:validateResponse.message});
          }
      }
      ,views: {
          'forgotPassword': {
              templateUrl: '/app/components/login/views/resetPassword.html'
          }
      }
  })
  </code></pre>
  
  <p>In developer tool I see that validateResponse resolves ok and in the onEnter function I see the resolved key 'validateResponse' with values in the arguments.</p>
  
  <p>In the controller I try to access the resolved property:</p>
  
  <pre><code>['validateResponse',function(validateResponse){
  console.log('validateResponse: ',validateResponse)
  ...
  }]
  </code></pre>
  
  <p>(only relevant parts are displayed here for brevity)</p>
  
  <p>...but the debugger never even gets to the line with console.log.
  In the view I do not have a validateResponse property in the $scope... not with $console.log() or Batarang scope view</p>
  
  <p>The parent state contains reference to the controller but even if I move controller to the child state it makes no difference:</p>
  
  <p>What is wrong here?????</p>