Skip to content

Access app configuration values from an easy to use service.

License

Notifications You must be signed in to change notification settings

gmurphey/ember-config-service

Repository files navigation

ember-config-service

Build Status Ember Observer Score Greenkeeper badge npm version npm

Get values from your app's config/environment.js with a service.

Compatibility

  • Ember.js v3.4 or above
  • Ember CLI v2.13 or above
  • Node.js v8 or above

Usage

Install this addon by running the following with Ember CLI.

ember install ember-config-service

The config service is now available for you to use in your app. For example, if you added the following to your config/environment.js:

ENV.api = {
  host: 'http://mydomain.com',
  namespace: 'myapi'
};

You could define your application adapter with the following:

import Ember from 'ember';
import DS from 'ember-data';

export default DS.JSONAPIAdapter.extend({
  config: Ember.inject.service(),

  host: Ember.computed.alias('config.api.host'),
  namespace: Ember.computed.alias('config.api.namespace')
});

Contributing

See the Contributing guide for details.

About

Access app configuration values from an easy to use service.

Resources

License

Stars

Watchers

Forks

Packages

No packages published