You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
371 B
20 lines
371 B
import {Pipe, PipeTransform} from '@angular/core';
|
|
import {DomSanitizer} from '@angular/platform-browser';
|
|
|
|
@Pipe({
|
|
name: 'html'
|
|
})
|
|
/**
|
|
* 解析html管道
|
|
*/
|
|
export class HtmlPipe implements PipeTransform {
|
|
|
|
constructor(private sanitizer?: DomSanitizer) {
|
|
|
|
}
|
|
|
|
transform(value: string): unknown {
|
|
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
}
|
|
|
|
}
|
|
|