12345678910111213141516171819202122 |
- import { Pipe } from '@angular/core';
- import * as i0 from "@angular/core";
- import * as i1 from "@angular/platform-browser";
- export class SafeImagePipe {
- constructor(sanitizer) {
- this.sanitizer = sanitizer;
- }
- transform(value, type = 'image/webp') {
- const imageBase64 = `data:${type};base64,${value}`;
- return this.sanitizer.bypassSecurityTrustUrl(imageBase64);
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SafeImagePipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); }
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.5", ngImport: i0, type: SafeImagePipe, isStandalone: true, name: "safeImage" }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SafeImagePipe, decorators: [{
- type: Pipe,
- args: [{
- name: 'safeImage',
- standalone: true,
- }]
- }], ctorParameters: () => [{ type: i1.DomSanitizer }] });
|