This.container.lookupFactory no longer works at ember@2.2.0

Starting from upgrade to ember@2.2.0

const config = this.container.lookupFactory('config:environment');` 

does not work any more. I can not use:

import ENV from 'your-application-name/config/environment'; 

because I really don’t know what the name of the application is, how I use it in the addon, as well as some drawings.

Which alternative?

+4
source share
2 answers

@ Jax's answer doesn't give a solution. I found a solution on the EmberJS forums :

Ember.getOwner(this).resolveRegistration('config:environment');

See http://emberjs.com/api/classes/RegistryProxyMixin.html#method_resolveRegistration

+5
source

Source: https://habr.com/ru/post/1617368/


All Articles