Skip to content

Commit

Permalink
Merge pull request #499 from teddyzeenny/fix-resolve-deprecation
Browse files Browse the repository at this point in the history
Use the new resolveRegistration
  • Loading branch information
teddyzeenny committed Nov 24, 2015
2 parents 1b32240 + 95d712b commit fb97e2c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ember_debug/data-debug.js
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 fb97e2c

Please sign in to comment.