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

@Pipe({
  name: 'truncatetext'
})
export class TruncatePipeText implements PipeTransform {

  transform(value: string, limit: number): string {
    if (value.length <= limit) {
      return value;
    } else {
      return value.substring(0, limit) + '...';
    }
  }

}
