« All deprecation guides

Deprecation Guide for Ember.ENV

until: 6.0.0
id: deprecate-import-env-from-ember

Previously, ENV could be accessed via the Ember import:

import Ember from 'ember';

Ember.ENV

If needed, ENV can be imported:

import MyEnv from '<my-app>/config/environment';

For addons, getting access to the environment requires having access to the owner:

import { getOwner } from '@ember/owner';

// ...

let env = getOwner(this).resolveRegistration('config:environment');