Angular Pipe

ng g pipe denemePipe

<div [innerHTML]=“question | denemePipe”></div>

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

/**
 * Generated class for the denemePipe pipe.
 *
 * See https://angular.io/api/core/Pipe for more info on Angular Pipes.
 */@Pipe({
  name: 'denemePipe',
})
export class DenemePipe implements PipeTransform {

  constructor(private sanitizer:DomSanitizer){}

  transform(html) {
    return this.sanitizer.bypassSecurityTrustHtml(html);
  }

}

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

This site uses Akismet to reduce spam. Learn how your comment data is processed.