title: initialization with serialize/deserialize ember.js
body: <p>I'm using the new <code>Router</code> without ember-data so I have to implement my own <code>serialize</code>/<code>deserialize</code> for dynamic url segments. </p>
  
  <p>I have an <code>ArrayController</code> which is populated with data within <code>Application#ready</code>.</p>
  
  <p>For simplicities sake, lets say I have 2 routes: <code>item &gt; '/item/:item_id'</code> &amp; <code>items &gt; '/items'</code>.</p>
  
  <p>The deserialize method in the <code>item</code> route looks something along the lines of this</p>
  
  <pre><code> deserialze: function(router, params){ 
       return router.get('myController')
                    .findProperty('id', params['item_id']);
   }
  </code></pre>
  
  <p>If I initialize my app on the <code>items</code> route and navigate to the <code>item</code> route for a specific item via an <code>{{action}}</code> everything works fine. Also, after this point I can manually change the url to specific <code>id</code>'s without a problem.</p>
  
  <p>However, if I try to start my app in the <code>item</code> route (ie <code>/item/2</code>), <code>deserialize</code> returns undefined. I'm assuming this is because <code>Application#ready</code> hasn't finished populating the controller. </p>
  
  <p>How do I get around this?</p>
  
  <p><strong>Edit:</strong> I think <a href="http://emberjs.com/guides/outlets/#toc_asynchrony" rel="nofollow">this</a> answers my question. Use ember-data.</p>
  
  <blockquote>
    <h1>ASYNCHRONY</h1>
    
    <p>One final point: you might be asking yourself how this system can work if the app has not yet loaded Post 1 > by the time <code>App.Post.find(1)</code> is called.</p>
    
    <p>The reason this works is that <code>ember-data</code> always returns an object immediately, even if it needs to kick off a query. That object starts off with an empty <code>data</code> hash. When the server returns the data, ember-data updates the object's <code>data</code>, which also triggers bindings on all defined attributes (properties defined using <code>DS.attr</code>).</p>
  </blockquote>