Page Contents

Home > @loopback/context > invokeMethod

invokeMethod() function

Invoke an instance method with dependency injection

Signature:

export declare function invokeMethod(target: object, method: string, ctx: Context, nonInjectedArgs?: any[]): ValueOrPromise<BoundValue>;

Parameters

Parameter Type Description
target object Target of the method, it will be the class for a static method, and instance or class prototype for a prototype method
method string Name of the method
ctx Context Context
nonInjectedArgs any[] Optional array of args for non-injected parameters

Returns:

ValueOrPromise<BoundValue>