short.ts 287 Bytes Edit Raw Blame History 1 2 3 4 5 6 7 8 9 10 11 12 13 import { PipeTransform, Pipe } from "@angular/core"; @Pipe ({ name: 'short' }) export class ShortPipe implements PipeTransform { transform(value: string): string { if(value === null){ value = ''; } return value.substr(0, 25) + ' ...'; } }