title: changingThisBreaksApplicationSecurity angular2
body: <p>I am trying to load a pdf document in an  tag in angular2 Dynamically, and when I am trying to change the URL iths throwing an error saying</p>
  
  <blockquote>
    <p>SafeResourceUrlImplchangingThisBreaksApplicationSecurity:
    "localhost:8002/pdf.pdf"<strong>proto</strong>: 
    SafeValueImplconstructor:
    SafeResourceUrlImpl()getTypeName: ()<strong>proto</strong>: Object</p>
    
    <p>localhost:8002/pdf.pdf Failed to load resource:
    net::ERR_UNKNOWN_URL_SCHEME</p>
  </blockquote>
  
  <p>Here's how I am setting the URL,
  This method will be called when I need to show the component</p>
  
  <pre><code>public show(): void {
      this.visible = true;
      this.visibleAnimate = true;
      console.log(this.src)
      this.DocURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
      console.log(this.DocURL);
  }
  
  
  constructor(private sanitizer: DomSanitizer) {
      this.visible = false;
      this.visibleAnimate = false;
  
      this.DocURL = this.sanitizer.bypassSecurityTrustResourceUrl(window.location.host + "/pdf.pdf");
  }
  </code></pre>
  
  <p>Heres the HTML Part</p>
  
  <pre><code>&lt;div style=" height:650;width:870"&gt;
      &lt;object width="870" height="650" type="application/pdf" [data]="DocURL" id="doc" #doc&gt;
          &lt;p&gt;Not able to display the document&lt;/p&gt;
      &lt;/object&gt;
      &lt;div style="display:none"&gt;
          &lt;iframe id="fred" #fred style="border:1px solid #666CCC" title="PDF in an i-Frame" [src]="DocURL" frameborder="1" scrolling="auto" height="1100" width="850" &gt;&lt;/iframe&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The URL I am supplying will be dynamic</p>