title: Angular 5 in safepipe get error - Required a safe ResourceURL, got a HTML
body: <p>In Angular 5, I want to show a map in <code>iFrame</code>. I used safepipe, however, receives error in console</p>
  <blockquote>
  <p>Required a safe ResourceURL, got a HTML</p>
  </blockquote>
  <p>Here is the code is my <code>.ts</code> file:</p>
  <pre class="lang-js prettyprint-override"><code>import { Pipe, PipeTransform } from '@angular/core';
  import { DomSanitizer} from '@angular/platform-browser';
  
  export class XXXComponent implements OnInit {
  constructor(private sanitizer: DomSanitizer){}
  
  this.mapURL = &quot;https://www.google.com/maps/embed/v1/place?key=AIzaSyDdWRYxwcpnrJWXbsR4fmP3HwvsFlCMYPk&amp;q=Ylistörmä+1,+02210+Espoo,+Finland&amp;attribution_source=Google+Maps+Embed+API&quot;;
  this.urlsafe = this.createSafeMap(this.mapURL);
  
  createSafeMap(url){
     return this.sanitizer.bypassSecurityTrustHtml(url);
  }
  </code></pre>
  <p>In the <code>.html</code> file, I did the following to show the map in iframe:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;iframe [src]=&quot;urlsafe | safe: 'html'&quot;&gt;&lt;/iframe&gt;
  </code></pre>
  <p>Below is the content of <code>safe.pipe.ts</code>:</p>
  <pre class="lang-js prettyprint-override"><code>import { Pipe, PipeTransform } from '@angular/core';
  import { DomSanitizer, SafeHtml, SafeStyle, SafeScript, SafeUrl, SafeResourceUrl } from '@angular/platform-browser';
      
  @Pipe({
     name: 'safe'
  })
  export class SafePipe implements PipeTransform {
      
     constructor(protected sanitizer: DomSanitizer) {}
       
     public transform(value: any, type: string): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl {
        switch (type) {
           case 'html': return this.sanitizer.bypassSecurityTrustHtml(value);
           case 'style': return this.sanitizer.bypassSecurityTrustStyle(value);
           case 'script': return this.sanitizer.bypassSecurityTrustScript(value);
           case 'url': return this.sanitizer.bypassSecurityTrustUrl(value);
           case 'resourceUrl': return this.sanitizer.bypassSecurityTrustResourceUrl(value);
           default: throw new Error(`Invalid safe type specified: ${type}`);
        }
     }
  }
  </code></pre>