Search code examples
ember.jsember-router

Emberjs - how to access router in RC1


In emberjs pre2 we could access router from any where like

App.get('router')

Can anybody suggest what could be the similar code for emberjs rc1?

Thanks


Solution

  • Can anybody suggest what could be the similar code for emberjs rc1?

    Emberjs rc1 does not expose the router in this way.

    As an alternative you should access router via local references.

    It's not just the router, pretty much everything that used to be accessible via global constants is now hidden. This is because using global constants to access instances breaks encapsulation, and while that is fine for the console it should be avoided in your application code.