Here is the pipe that I'm trying to use to render HTML on the page:
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
@Pipe({ name: "safeHtml" })
export class SafeHtmlPipe implements PipeTransform {
constructor(private domSanitizer: DomSanitizer) { }
transform(value: string): SafeHtml {
return this.domSanitizer.bypassSecurityTrustHtml(value);
}
}
Here is how I'm using it on the HTML page:
<div [outerHTML]="dataItem.content | safeHtml"></div>
I've also tried using [innerHTML], but that didn't change anything.
Everything I've seen online seems to claim this should be working so am I missing something?