title: Global Application State in Aurelia
body: <p>I'm trying to inject a class to other places in my Aurelia app to share authentication state after login. I'm following this example <a href="http://hobbit-on-aurelia.net/appstate/" rel="nofollow">http://hobbit-on-aurelia.net/appstate/</a> but it looks like the scope is lost during transitions or they are independent instances. Aurelia's docs says:</p>
  
  <blockquote>
    <p>By default, the DI container assumes that everything is a singleton
    instance;</p>
  </blockquote>
  
  <p>When I set the router doing <code>this.userSession.router = router</code> from app instance, the userSession instance is not updated. <code>this.loggedUser</code> is always undefined from outside.</p>
  
  <p>Here is my plunker: <a href="http://plnkr.co/edit/qXtSGx" rel="nofollow">http://plnkr.co/edit/qXtSGx</a></p>