You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
391 B
16 lines
391 B
6 months ago
|
import { Pipe, PipeTransform } from '@angular/core';
|
||
|
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
|
||
|
|
||
|
@Pipe({
|
||
|
name: 'url'
|
||
|
})
|
||
|
export class UrlPipe implements PipeTransform {
|
||
|
|
||
|
constructor(private _sanitizer: DomSanitizer) { }
|
||
|
|
||
|
transform(object: string): SafeUrl {
|
||
|
return object && this._sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(object));
|
||
|
}
|
||
|
|
||
|
}
|