DefaultValuePipe

Defines the built-in DefaultValue Pipe

  
class DefaultValuePipe<T = any, R = any> implements PipeTransform {
  protected defaultValue: R
  transform(value?: T, _metadata?: ArgumentMetadata): T | R
}

See also

Properties

Property Description
protected defaultValue: R Read-only.

Methods

transform()


transform(value?: T, _metadata?: ArgumentMetadata): T | R

Parameters

Option Type Description
value T

Optional. Default is undefined.

_metadata ArgumentMetadata

Optional. Default is undefined.

Returns

T | R