Попробуйте следующим образом
В компоненте
import { Component } from '@angular/core';
//This is required
import { DomSanitizer } from '@angular/platform-browser';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
//Constructor Required
constructor(private sanitizer:DomSanitizer){
}
//Call this method in the image source, it will sanitize it.
transform(){
return this.sanitizer.bypassSecurityTrustResourceUrl(this.base64Image);
}
base64Image='data:image/png;base64, /9j/4AAQSkZJRgABAQAAAQABAAD/2wBD.......';
}
В HTML
<img [src]="transform()">