Skip to content

Commit

Permalink
[FEATURE factory-for] Only expose factoryFor w/ FF
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic committed Dec 18, 2016
1 parent 54a5c15 commit aefb6ed
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/ember-runtime/lib/mixins/container_proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
FACTORY_FOR,
LOOKUP_FACTORY
} from 'container';
import { isFeatureEnabled } from 'ember-metal';

/**
ContainerProxyMixin is used to provide public access to specific
Expand All @@ -18,7 +19,7 @@ import {
@class ContainerProxyMixin
@private
*/
export default Mixin.create({
let containerProxyMixin = {
/**
The container stores state.
Expand Down Expand Up @@ -142,9 +143,13 @@ export default Mixin.create({
if (this.__container__) {
run(this.__container__, 'destroy');
}
},
}
};

factoryFor(fullName, options = {}) {
if (isFeatureEnabled('ember-factory-for')) {
containerProxyMixin.factoryFor = function ContainerProxyMixin_factoryFor(fullName, options = {}) {
return this.__container__.factoryFor(fullName, options);
}
});
};
}

export default Mixin.create(containerProxyMixin);

0 comments on commit aefb6ed

Please sign in to comment.