mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-04-16 21:35:13 +00:00
18 lines
405 B
TypeScript
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, '') : '';
|
|
}
|
|
}
|