import { Pipe } from '@angular/core' ; @ Pipe ( { name : 'excerpt' , } ) export class ExcerptPipe { transform ( value , maxLength = 140 ) { if ( ! value || value . length <= maxLength ) return value ; return value . substring ( 0 , maxLength ) + '...' ; } }