I'm upgrading an ember/ember-cli application to ember 1.12. I'm now receiving the following deprecation warning:
DEPRECATION: `lookup` was called on a Registry. The `initializer` API no longer receives a container,
and you should use an `instanceInitializer` to look up objects from the container.
See http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers for more details.
Looking at the example, I see that things like the following:
App.initializer({
name: "clock",
initialize: function(container, application) {
application.register("clock:main", Clock);
var clock = container.lookup("clock:main");
clock.setStartTime(Date.now());
}
});
Should be changed to:
App.initializer({
name: "clock",
initialize: function(registry, application) {
application.register("clock:main", Clock);
}
});
App.instanceInitializer({
name: "clock",
initialize: function(instance) {
var clock = instance.container.lookup("clock:main");
clock.setStartTime(Date.now());
}
});
But I don't have anything like that code at all. What in an ember-cli 0.2.5 application would cause this warning?