This is the documentation for Angular 6.
You can switch to the latest version Angular 7.

A pipe takes in data as input and transforms it to a desired output.


Here's a custom pipe that doubles a value:

import { Pipe, PipeTransform } from '@angular/core';

@Pipe({name: 'double'})
export class DoublePipe implements PipeTransform {
  transform(value: number): number {
    return value * 2;


{{ value | double }} 



The pipe name to use in template bindings.

name: string


When true, the pipe is pure, meaning that the transform() method is invoked only when its input arguments change. Pipes are pure by default.

pure: boolean

If the pipe has internal state (that is, the result depends on state other than its arguments), set pure to false. In this case, the pipe is invoked on each change-detection cycle, even if the arguments have not changed.