# 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