What is the PipeTransform interface?

As the name suggests, the interface receives an input value and transforms it into the desired format with a transform() method. It is typically used to implement custom pipes.

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

 @Pipe({

  name: 'demopipe'

})

export class DemopipePipe implements PipeTransform {

  transform(value: unknown, ...args: unknown[]): unknown {

    return null;

  }

}

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *