gpt4 book ai didi

ember.js - this.container.lookupFactory 不再适用于 ember@2.2.0

转载 作者:行者123 更新时间:2023-12-04 22:58:34 25 4
gpt4 key购买 nike

自从更新到 ember@2.2.0

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

不再有效。我不能使用:
import ENV from 'your-application-name/config/environment'; 

因为我实际上不知道应用程序名称是什么,因为我在插件和一些蓝图中使用它。

什么是替代方案?

最佳答案

@jax 的回答没有提供解决方案。我找到了 solution on EmberJS forums :

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

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

关于ember.js - this.container.lookupFactory 不再适用于 ember@2.2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33909015/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com