Access App from different controllers

I’m using Ember-cli for organizing my application. I’ve extended App to have a token variable that I can access globally.

Now, I was able to access it like this: window.MyAPP.token. However, it feels a little wrong and I was wondering if there’s a different way to access token from other places.


You can inject stuff in every route and controller with injections:

Its the what is done with the store, so its accessible everywhere

I ended up having the variable in the controller and the one place different I needed to access it, I had this.controllerFor('myController').get('variable').