jeudi 3 août 2017

How to use global variables in Ember app, specifically in index.html?

I would like to directly modify the index.html of my Ember app using command line variables passed in. So I can set them under 'ENV' in my environment.js file, and then I can access them in some of my .js files by importing ENV. However, in my index.html file, these variables don't show up even though the "rootURL" variable does. For example, if I set rootURL: "/blah" and var1: "/blah2" in ENV, then if I have something like a href= and a href = , then the first link works while the second doesn't.

So I'm assuming that doesn't come directly from the ENV variable, but I can't find where it comes from. I was trying to do something similar with variables in my 'app.js' but I'm confused about this line: import config from './config/environment'; What exactly does this import? I can't find anything named "config" in environment.js. Is it possible to set global variables in that file (app.js)?




Aucun commentaire:

Enregistrer un commentaire