相关文章推荐
深沉的便当  ·  GitHub | DevOps ...·  4 月前    · 
绅士的竹笋  ·  海悅聯名卡·  1 年前    · 
阳刚的烤地瓜  ·  Parsing dates in ...·  1 年前    · 
刚毅的酱牛肉  ·  java bufferedwriter ...·  1 年前    · 
import {Pipe, PipeTransform} from "@angular/core";
import {DomSanitizer} from "@angular/platform-browser";
@Pipe({
  name: "html"
export class HtmlPipe implements PipeTransform{
  constructor (private sanitizer: DomSanitizer) {
  transform(style) {
    return this.sanitizer.bypassSecurityTrustHtml(style);

html使用

<p [innerHTML]="content | html"></p>