# Args Decorator
Module | import { Args } from "@tsed/socketio" |
---|---|
Source | /packages/socketio/src/decorators/args.ts |
# Overview
function Args(mapIndex?: number, useType?: any): any;
# Description
Inject the list of arguments in the decorated parameter.
@Args
accept an index parameter to pick up directly the item in the arguments list.
# Example
@SocketService("/nsp")
export class MyWS {
@Input("event")
myMethod(@Args() arguments: any[]) {
}
@Input("event2")
myMethod2(@Args(0) data: any) {
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing