typeioc

Home > typeioc > IContainer > resolveWithDependenciesAsync

IContainer.resolveWithDependenciesAsync() method

Asynchronously resolves a service with dynamic dependencies

Signature:

resolveWithDependenciesAsync<R>(service: {}, dependencies: IDynamicDependency[]): Promise<R>;

Parameters

Parameter Type Description
service {} service value registered prior resolution
dependencies IDynamicDependency[] an array of IDynamicDependency instances

Returns:

Promise<R>

Remarks

A service gets resolved with all the dependencies provided without affecting original registration. All the services resolved with dynamic dependencies get transient (no scope, scope) life cycle assigned regardless of initial life cycle specified