-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove window.MyAppNameENV
.
#1903
Conversation
How should I access the information here if it's not available globally? I'm using it for a few things like API_HOST and whatnot. |
import config from '../config/environment'; |
import ENV from '<appName>/config/environment';
ENV.API_HOST; // example.com |
I want to hold off on this until after 0.0.44 is out. |
@jayphelps @rwjblue What if you are not in an environment where you can i.e. After
I had been using |
@brandonparsons I'm doing the following which works quite well for me: <script>
(function(){
var config = require('app/config/environment')['default'];
config.foo = 'bar';
window.EmberENV = config.EmberENV;
require('app/app')['default'].create(config.APP);
})();
</script> |
Yay |
One more step to strict csp compliance |
@joostdevries Thanks for sharing that - saved my day :) |
Can anyone please help regarding ember-cli. |
You can set the variable in
Then where you need access just import the config module and use the variable. For example:
|
Hi, I tried to import the config file(import config from '../config/environment';), I want to do this in controller file,I am getting the following error while building ENOENT, no such file or directory 'D:\CPS\CPS-UI\cpsui\tmp\tree_merger-tmp_dest_dir-GDbdsFCI.tmp\todo-ember\config\environment.js' Please help,many thanks for quick response |
Hi , Is there any other way to import config file. Please help |
|
I tried everything ,but everytime I build it is giving me tmp folder error no such file exist |
Most likely you are not running a version of ember-cli that supports this. Please upgrade to the latest version. |
npm ver -1.4.21 the config folder is outside the app folder ,so will the import work |
Hi, I was able to access the environment data in controller by accessing it through index.html |
Closes #1895.
I decided to not go with a deprecation for now. Having to manually update your app (and a
0.0.x
number) means it is likely OK to have a bit of upgrading to do.