import { Pipe , PipeTransform } from '@angular/core' ; @ Pipe ( { name : 'trim' } ) export class TrimPipe implements PipeTransform { transform ( value ) { if ( ! value ) { return '' ; } return value . toString ( ) . trim ( ) ; } }