Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #angular #innerhtml #style #working
ADD COMMENT
Topic
Name
2+3 =