Param

Route handler parameter decorator. Extracts the params property from the req object and populates the decorated parameter with the value of params. May also apply pipes to the bound parameter.

See more...


 @Param(property?: string | PipeTransform<any, any> | Type<PipeTransform<any, any>>, ...pipes: (PipeTransform<any, any> | Type<PipeTransform<any, any>>)[])

Parameters

Option Type Description
property string | PipeTransform | Type>

name of single property to extract from the req object


Optional. Default is `undefined`.
pipes (PipeTransform | Type>)[]

one or more pipes - either instances or classes - to apply to the bound parameter.

Returns

ParameterDecorator

See also

Description

For example, extracting all params:


findOne(@Param() params: string[])

For example, extracting a single param:


findOne(@Param('id') id: string)