Answers for "angular innerhtml style not working"

1

angular innerhtml style not working

import { DomSanitizer } from '@angular/platform-browser'
import { PipeTransform, Pipe } from "@angular/core";

@Pipe({ name: 'safeHtml'})
export class SafeHtmlPipe implements PipeTransform  {
  constructor(private sanitized: DomSanitizer) {}
  transform(value) {
    return this.sanitized.bypassSecurityTrustHtml(value);
  }
}

...

<div [innerHtml]="html | safeHtml"></div>
Posted by: Guest on December-30-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language