ember-get-config
TypeScript icon, indicating that this package has built-in type declarations

2.1.1 • Public • Published

npm version GitHub Actions Build Status

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:

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:

import config from 'ember-get-config';

Which allows you to do handy things like:

const { environment, modulePrefix } = config;

Boom!

Contributing

See the Contributing guide for details.

Readme

Keywords

Package Sidebar

Install

npm i ember-get-config

Weekly Downloads

148,954

Version

2.1.1

License

MIT

Unpacked Size

573 kB

Total Files

81

Last publish

Collaborators

  • real_ate
  • nullnullnull