fuse-angular/src/@fuse/pipes/htmlToPlaintext.pipe.ts
2018-05-20 10:12:31 +03:00

18 lines
405 B
TypeScript

import { Pipe, PipeTransform } from '@angular/core';
@Pipe({name: 'htmlToPlaintext'})
export class HtmlToPlaintextPipe implements PipeTransform
{
/**
* Transform
*
* @param {string} value
* @param {any[]} args
* @returns {string}
*/
transform(value: string, args: any[] = []): string
{
return value ? String(value).replace(/<[^>]+>/gm, '') : '';
}
}