Registry#resolve()

resolve (fullName, options) Functionprivate

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

Given a fullName return the corresponding factory.

By default resolve will retrieve the factory from the registry.

let registry = new Registry();
registry.register('api:twitter', Twitter);

registry.resolve('api:twitter') // => Twitter

Optionally the registry can be provided with a custom resolver. If provided, resolve will first provide the custom resolver the opportunity to resolve the fullName, otherwise it will fallback to the registry.

let registry = new Registry();
registry.resolver = function(fullName) {
   // lookup via the module system of choice
 };

// the twitter factory is added to the module system
registry.resolve('api:twitter') // => Twitter

Parameters:

fullName String
options [Object]
source [String]
the fullname of the request source (used for local lookups)

Returns:

Function
fullName's factory
doc_EmberJs
2016-11-30 16:52:57
Comments
Leave a Comment

Please login to continue.