Created
February 12, 2018 06:24
-
-
Save ivkan/e487f1610913cb8201abfe16d4db5439 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Pipe, PipeTransform } from '@angular/core'; | |
| @Pipe({name: 'htmlToPlaintext'}) | |
| export class HtmlToPlaintextPipe implements PipeTransform | |
| { | |
| transform(value: string, args: any[] = []) | |
| { | |
| return value ? String(value).replace(/<[^>]+>/gm, '') : ''; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment