[英]How solve this - Using the injected `container` is deprecated. Ember 2.3
How solve this follow message em emberjs 2.3 如何解决这个关注消息em emberjs 2.3
After upgrade version this start appear. 升级版本后,此开始出现。
Using the injected container is deprecated. Please use the getOwner helper instead to access the owner of this object
As Kitler mentioned, Ember's changelog is a good place to check for how to handle deprecations, but sometimes it can be confusing if you're new to Ember. 正如Kitler所提到的, Ember的更改日志是检查如何处理弃用的好地方,但有时如果你是Ember的新手,可能会让人感到困惑。
Search your code for this.container
or export function initialize(application, container)
. 在代码中搜索
this.container
或export function initialize(application, container)
。 Replace that with something like this: 用以下内容替换:
let owner = Ember.getOwner(this);
owner.lookup('whatever:was:in:this.container.lookup');
Making that change should silence the deprecation message and fix your app. 进行此更改应该使弃用消息静音并修复您的应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.