title: Passing data from controller to route in Ember
body: <p>I'm trying to figure out how data received from a controller can be used in a different route in Ember.js.</p>
  
  <p>I've got a controller like this, which is making an Ajax call and upon success, calls the <code>successCallback</code> function:</p>
  
  <pre><code>App.LoginController = Ember.ArrayController.extend({
    ...
    function successCallback(json){
      var userData = json;
      self.transitionToRoute('dashboard');
    }
    ...
  });
  </code></pre>
  
  <p>I'm trying to retrieve this <code>userData</code> in LoginController and use it in the dashboard view.</p>
  
  <pre><code>App.DashboardRoute = Ember.Route.extend({
    model: function(){
      return this.controllerFor('login').get('userData');
    }
  });
  </code></pre>
  
  <p>I've tried consoling out the results of <code>this.controllerFor('login').get('userData');</code> but nothing returns. But consoling out the data before transitioning in the LoginController shows that the data did get assigned to the variable <code>userData</code>.</p>
  
  <p>Any help would be great!</p>