Registry#factoryTypeInjection()

factoryTypeInjection (type, property, fullName) private

Defined in packages/container/lib/registry.js:555

Used only via factoryInjection.

Provides a specialized form of injection, specifically enabling all factory of one type to be injected with a reference to another object.

For example, provided each factory of type model needed a store. one would do the following:

let registry = new Registry();

registry.register('store:main', SomeStore);

registry.factoryTypeInjection('model', 'store', 'store:main');

let store = registry.lookup('store:main');
let UserFactory = registry.lookupFactory('model:user');

UserFactory.store instanceof SomeStore; //=> true

Parameters:

type String
property String
fullName String
doc_EmberJs
2016-11-30 16:52:54
Comments
Leave a Comment

Please login to continue.