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