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

@Pipe({
  name: 'subStr'
})
export class SubStrPipe implements PipeTransform {

  //根据字符串的长度，截取
  transform(value: any, length?:any): any {
    if(value && value.length > length) {
      return value.substring(0,length)+'...';
    }
    return value;
  }

}
