Skip to content

Commit

Permalink
app.inject has be deprecated in-favor of lazy injections
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpenner committed Sep 9, 2021
1 parent be0d5bb commit 53795a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions addon/resolvers/classic/container-debug-adapter.js
Original file line number Diff line number Diff line change
@@ -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 + '$'));
Expand All @@ -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();
Expand Down
1 change: 0 additions & 1 deletion app/initializers/container-debug-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
};

0 comments on commit 53795a1

Please sign in to comment.