HostParam
Route handler parameter decorator. Extracts the hosts
property from the req
object and populates the decorated
parameter with the value of params
. May also apply pipes to the bound
parameter.
@HostParam(property?: string | PipeTransform<any, any> | Type<PipeTransform<any, any>>)
Parameters
Option | Type | Description |
---|---|---|
property
|
string | PipeTransform |
name of single property to extract from the
|
Returns
ParameterDecorator
See also
Description
For example, extracting all params:
findOne(@HostParam() params: string[])
For example, extracting a single param:
findOne(@HostParam('id') id: string)