title: Ember.js - Call parent model hook to load data for child
body: <p>I have a master/detail view in Ember. If i am calling the detail page directly, the model hook of the detail page needs the model(data) from the parent(master). The detail model hook is called - whats the proper way to get/call the model so the modelFor function in the detail hook works.</p>
  
  <p>Router:</p>
  
  <pre><code>App.Router.map(function(){
      this.resource('index', { path: '/' } );
      this.resource('devices', { path: '/devices'}, function() {
          this.resource('device', { path: ':imei'});
      });
  });
  </code></pre>
  
  <p>Master Route:</p>
  
  <pre><code>App.DevicesIndexRoute = Ember.Route.extend({
      model: function() {
  
          var self = this;
          return requestController.get({
              url: "foo/bar/",
              success: function(data) {
                  console.log(data);
                  return data;
              },
              error: function() {
                  console.log("error");
                  return [];
              }
          });
      }
  });
  </code></pre>
  
  <p>Detail Route:</p>
  
  <pre><code>    App.DeviceRoute = Ember.Route.extend({
          model: function(args) {
  ////// Gets Called - needs data from master!!
              var model = this.modelFor('devices.index').findBy('imei', args.imei);
              return model;
          }
      });
  </code></pre>
  
  <p>Thanks for help</p>