Could someone please provide an example for this. I am not getting this to work.
I have set an environment variable in my config/environment.js file. In a route action I want to access this variable. But ENV is undefined.
environment.js
if (environment === 'test') {
ENV.APP.REPORTING_SERVICE_URL = 'http://ift.tt/xKZb52';
}
if (environment === 'production') {
ENV.APP.REPORTING_SERVICE_URL = 'http://ift.tt/fyw30c';
}
Route
import ENV from 'my-demo-app/config/environment';
export default Ember.Route.extend({
actions: {
doSomething: function() {
console.log(ENV.REPORTING_SERVICE_URL); // ENV is undefined
}
}
});
Aucun commentaire:
Enregistrer un commentaire