Page Contents

Home > @loopback/context > invokeMethod

invokeMethod() function

Invoke a method using dependency injection. Interceptors are invoked as part of the invocation.


export declare function invokeMethod(target: object, method: string, ctx: Context, nonInjectedArgs?: InvocationArgs, options?: InvocationOptions): ValueOrPromise<InvocationResult>;


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 object
nonInjectedArgs InvocationArgs (Optional) Optional array of args for non-injected parameters
options InvocationOptions (Optional) Options for the invocation