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

@Pipe({ name: 'sanitizeUrl' })
export class ImageSanitizerPipe implements PipeTransform {

    constructor(public dom: DomSanitizer) {}

    transform(base64: string): SafeUrl {
        return this.dom.bypassSecurityTrustUrl("data:image/jpeg;base64," + base64);
    }
}