Skip to content
pro-txt.ts 339 B
Newer Older
wangqinghua's avatar
wangqinghua committed
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'proTxt',
})
export class ProTxtPipe implements PipeTransform {
  /**
   * Takes a value and makes it lowercase.
   * 文字换行 空格
   */
  transform(value: string, ...args) {
      return value && value.replace(/\r?\n/g, "<br />").replace('undefined','');
  }
}