// truncate.pipe.ts
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'truncate'
})
export class TruncatePipe implements PipeTransform {
  transform(value: string, length: number = 50): string {
    if (value.length > length) {
      return value.substr(0, length) + '...';
    }
    return value;
  }
}
