Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ezy/49f08023702f3034f26166d4fd99fdc5 to your computer and use it in GitHub Desktop.
Save ezy/49f08023702f3034f26166d4fd99fdc5 to your computer and use it in GitHub Desktop.
How to lookup or resolve other class instances, or register new factories into the owner.
/**
* For Ember < 2.4
*/
this.get('container').lookup('router:main').router.state;
/**
* For Ember > 2.4
*/
import Ember from 'ember';
const { getOwner } = Ember;
getOwner(this).lookup('router:main').router.state;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment