typeioc

Home > typeioc > IContainer > resolveWithDependencies

IContainer.resolveWithDependencies() method

Resolves a service with dynamic dependencies

Signature:

resolveWithDependencies<R>(service: {}, dependencies: IDynamicDependency[]): R | never;

Parameters

Parameter Type Description
service {} service value registered prior resolution If service is null or undefined ArgumentError is thrown
dependencies IDynamicDependency[] an array of IDynamicDependency instances

Returns:

R | never

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

Throws ResolutionError if not registration found