Function: After()
Less than 1 minute
AspectJS • Docs
Function: After()
After(...
args
):MethodDecorator
Annotation to declare an advice to be applied after a method. The After annotation is used to apply after advice to a method. After advice is executed after the target method completes its execution normally or with an error. It is commonly used to perform cleanup tasks, logging, or additional actions that need to be executed after the method's execution.
Parameters
• ...args: PointcutExpression
<PointcutKind
>[]
Returns
MethodDecorator
An ES decorator representing the After annotation.
Example
import { After, on } from '@aspectjs/core';
class MyClass {
@After(on.classes.withAnnotations(SomeAnnotation))
myMethod() {
// Method implementation
}
}
Defined in
packages/core/src/advices/after/after.annotation.ts:28