Quantcast
Viewing all articles
Browse latest Browse all 4827

How to access Ember container from the window?

@robert-j-webb wrote:

Hi!

I found I had this as a question and I found the answer with some help. I hope this helps someone one day. You probably shouldn’t do this by the way - accessing private methods generally is a bad practice, but it can be a life saver if you have to make a deadline.

let app = Ember.Namespace.NAMESPACES.find(namespace => namespace instanceof Ember.Application)
let router = app.__container__.lookup('service:router');

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4827

Trending Articles