ohayolibs
Version:
Ohayo is a set of essential modules for ohayojp.
12 lines (9 loc) • 356 B
text/typescript
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
({ name: 'html' })
export class HTMLPipe implements PipeTransform {
constructor(private dom: DomSanitizer) {}
transform(html: string): string | SafeHtml {
return html ? this.dom.bypassSecurityTrustHtml(html) : '';
}
}