Get `config/environment` from anywhere, even addons!!!
MIT License
Gaining access to an app's config file from an addon can be challenging. If possible, you should always get it through the container like so:
export default Ember.Component.extend({
someFunction() {
const config = Ember.getOwner(this).resolveRegistration('config:environment');
. . . .
}
});
If you do not have access to the container though, you can always use ember-get-config
.
ember install ember-get-config
Simply:
import config from 'ember-get-config';
Which allows you to do handy things like:
const { environment, modulePrefix } = config;
Boom!
See the Contributing guide for details.