From 53795a1e4eb16b6b140d78d759a87c4993a39546 Mon Sep 17 00:00:00 2001 From: Stefan Penner Date: Thu, 9 Sep 2021 10:23:00 -0600 Subject: [PATCH] app.inject has be deprecated in-favor of lazy injections --- addon/resolvers/classic/container-debug-adapter.js | 2 ++ app/initializers/container-debug-adapter.js | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addon/resolvers/classic/container-debug-adapter.js b/addon/resolvers/classic/container-debug-adapter.js index dd170b4c..dd3e99ad 100644 --- a/addon/resolvers/classic/container-debug-adapter.js +++ b/addon/resolvers/classic/container-debug-adapter.js @@ -1,6 +1,7 @@ import { A } from '@ember/array'; import ContainerDebugAdapter from '@ember/debug/container-debug-adapter'; import { ModuleRegistry } from './index'; +import { getOwner } from '@ember/application'; function getPod(type, key, prefix) { let match = key.match(new RegExp('^/?' + prefix + '/(.+)/' + type + '$')); @@ -19,6 +20,7 @@ export default ContainerDebugAdapter.extend({ init() { this._super(...arguments); + this.namespace = getOwner(this).lookup('application:main'); if (!this._moduleRegistry) { this._moduleRegistry = new ModuleRegistry(); diff --git a/app/initializers/container-debug-adapter.js b/app/initializers/container-debug-adapter.js index b6e3d104..4f6794d6 100644 --- a/app/initializers/container-debug-adapter.js +++ b/app/initializers/container-debug-adapter.js @@ -7,6 +7,5 @@ export default { let app = arguments[1] || arguments[0]; app.register('container-debug-adapter:main', ContainerDebugAdapter); - app.inject('container-debug-adapter:main', 'namespace', 'application:main'); } };