Skip to content

mansona/ember-get-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jul 1, 2022
552ce14 · Jul 1, 2022
Jun 28, 2022
Jun 28, 2022
Nov 5, 2015
Jun 28, 2022
Jun 29, 2022
Nov 5, 2015
Nov 5, 2015
Oct 17, 2021
Nov 5, 2015
Oct 17, 2021
Jun 29, 2022
Oct 17, 2021
Jun 29, 2022
Oct 17, 2021
Oct 17, 2021
Oct 17, 2021
Apr 27, 2016
Jul 1, 2022
Oct 17, 2021
Apr 27, 2016
Oct 28, 2021
Oct 16, 2021
Jun 28, 2022
Apr 6, 2022
Apr 22, 2022
Jul 1, 2022
Jul 1, 2022
Oct 17, 2021

Repository files navigation

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.