https://github.com/mansona/ember-get-config
Get `config/environment` from anywhere, even addons!!!
https://github.com/mansona/ember-get-config
ember ember-addon hacktoberfest
Last synced: 3 months ago
JSON representation
Get `config/environment` from anywhere, even addons!!!
- Host: GitHub
- URL: https://github.com/mansona/ember-get-config
- Owner: mansona
- License: mit
- Created: 2015-11-06T02:44:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-18T12:38:04.000Z (12 months ago)
- Last Synced: 2025-03-27T12:42:09.489Z (3 months ago)
- Topics: ember, ember-addon, hacktoberfest
- Language: JavaScript
- Homepage:
- Size: 1.97 MB
- Stars: 65
- Watchers: 4
- Forks: 20
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://badge.fury.io/js/ember-get-config)
[](https://github.com/mansona/ember-get-config/actions/workflows/ci.yml?query=branch%3Amaster)# ember-get-config
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:
```js
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`.
## Installation
`ember install ember-get-config`
## Usage
Simply:
```js
import config from 'ember-get-config';
```Which allows you to do handy things like:
```js
const { environment, modulePrefix } = config;
```Boom!
## Contributing
See the [Contributing](CONTRIBUTING.md) guide for details.