Registry#optionsForType()

optionsForType (type, options) private

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

Allow registering options for all factories of a type.

let registry = new Registry();
let container = registry.container();

// if all of type `connection` must not be singletons
registry.optionsForType('connection', { singleton: false });

registry.register('connection:twitter', TwitterConnection);
registry.register('connection:facebook', FacebookConnection);

let twitter = container.lookup('connection:twitter');
let twitter2 = container.lookup('connection:twitter');

twitter === twitter2; // => false

let facebook = container.lookup('connection:facebook');
let facebook2 = container.lookup('connection:facebook');

facebook === facebook2; // => false

Parameters:

type String
options Object
doc_EmberJs
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.