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.
@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 |
name of single property to extract from the
|
pipes
|
(PipeTransform |
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)