Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

this.container.lookupFactory no longer works in [email protected]

Tags:

ember.js

Since updating to [email protected]

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

no longer works. I can't use:

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

because I don't actually know what the application-name is as I am using this in an addon and also some blueprints.

What is the alternative?

like image 659
jax Avatar asked Jan 08 '23 03:01

jax


1 Answers

The answer by @jax does not provide the solution. I found the solution on EmberJS forums:

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

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

like image 131
Kashif Avatar answered Mar 07 '23 22:03

Kashif