How to get access to global variable in template?
问题 I want to create global object with settings which I need to get from REST API. I need to make one request to REST API and get settings and after that I want to get access to these settings from any controllers and from any templates. What can you advice, what is the best practice for that problem? 回答1: Concept Good practice would be to use initializers. They allow injection of any data to routes, controllers or any other kind of object. Lets take an example ( example from Ember.js official