import { Pipe , PipeTransform } from '@angular/core' ; import { DomSanitizer , SafeUrl } from '@angular/platform-browser' ; @ Pipe ( { name : 'url' } ) export class URLPipe implements PipeTransform { constructor ( private dom ) { } transform ( url ) { return url ? this . dom . bypassSecurityTrustUrl ( url ) : '' ; } }