Skip to content

Commit

Permalink
Use the new resolveRegistration
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyzeenny committed Nov 23, 2015
1 parent 1b32240 commit 95d712b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ember_debug/data-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ export default EmberObject.extend(PortMixin, {
}),

_resolve(name) {
const container = this.get('application').__container__;
// Ember >= 2.1
if (this.get('application').resolveRegistration) {
return this.get('application').resolveRegistration(name);
}
let container = this.get('application').__container__;
let registry = this.get('application.registry');
if (registry) {
// Ember >= 1.11
return registry.resolve(name);
} else if (container.resolve) {
// Ember < 1.11
return container.resolve(name);
} else if (container.resolveRegistration) {
// Ember >= 2.1
return container.resolveRegistration(name);
} else {
// Ember >= 2.0 < 2.1
return container.registry.resolve(name);
Expand Down

0 comments on commit 95d712b

Please sign in to comment.