自更新到 ember@2.2.0
const config = this.container.lookupFactory('config:environment');`
不再有效。我不能用:
import ENV from 'your-application-name/config/environment';
因为我实际上并不知道应用程序名称是什么,因为我在插件和蓝图中使用它。
有什么替代方案?
答案 0 :(得分:6)
@jax的答案没有提供解决方案。我找到了solution on EmberJS forums:
Ember.getOwner(this).resolveRegistration('config:environment');
请参阅http://emberjs.com/api/classes/RegistryProxyMixin.html#method_resolveRegistration
答案 1 :(得分:2)