Page Contents

Home > @loopback/context > InvocationContext

InvocationContext class

InvocationContext represents the context to invoke interceptors for a method. The context can be used to access metadata about the invocation as well as other dependencies.

Signature:

export declare class InvocationContext extends Context 

Constructors

Constructor Modifiers Description
(constructor)(parent, target, methodName, args)   Construct a new instance of InvocationContext

Properties

Property Modifiers Type Description
args   InvocationArgs  
description   string Description of the invocation
methodName   string  
parent   Context  
target   object  
targetClass   Function The target class, such as OrderController
targetName   string The target name, such as OrderController.prototype.cancelOrder

Methods

Method Modifiers Description
assertMethodExists()   Assert the method exists on the target. An error will be thrown if otherwise.
invokeTargetMethod(options)   Invoke the target method with the given context
toString()