Mad Scientist
Mad Scientist

Reputation: 340

Ember JS how to set property accessible in all templates

This is a pretty noobie question but I searched for this over the internet in vain for many days now.

I am building an Application which has an Ember front end server connecting to a Node JS back end. For development and testing both Node and Ember are running on my local machine at localhost:3000 and localhost:4200 respectively. However some resources like images etc. are getting saved on the Node server and to fetch those resources I am having to hardcode the server ip in my template. For instance <img src="http://localhost:3000/"{{brand.imgLocation}}/>

This is a nightmare because whenever I need to update to production server I am having to change it to Node Server IP in every place across all templates which is inconsistent. Is there a place where I can store it as a property accessible to all templates ,I tried saving it as a property in Index Controller but it is not accessible in other templates except for Index template.

Upvotes: 0

Views: 51

Answers (1)

jmurphyau
jmurphyau

Reputation: 2309

The Application Controller exists on every page. That would be the best place for it I think.

Upvotes: 1

Related Questions