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.

See more...


 @HostParam(property?: string | 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`.

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)