title: Iframe loading through a get request in angular 5
body: <p>I am embedding the grafana dashboard in my angular app. I have the following component in my angular app. </p>
  
  <pre><code>test.component.html
  
  &lt;div class="dashboard"&gt;
      &lt;iframe width="100%" height="100%" [src]="url | safe" style="border:none;"&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is basically a grafana iframe</p>
  
  <p>I wanted to add some auth headers before loading the iframe, so instead of directly loading the iframe I added code to make a get request to the iframe.</p>
  
  <p>Here is the code that I added to test.component.ts</p>
  
  <pre><code>    ngOnInit() {
  
          this.get(this.url).subscribe(blob =&gt; this.iframe.nativeElement.src = blob);
      }
  
      get(url: string): Observable&lt;any&gt; {
          const options = {
              headers: new HttpHeaders({
                  'X-WEBAUTH-USER': 'niranjan'
              }),
              responseType: 'blob' as 'json'
          }
  
          return new Observable((observer: Subscriber&lt;any&gt;) =&gt; {
              let objectUrl: string = null;
  
              this.http
                  .get(url, options)
                  .subscribe(m =&gt; {
                      objectUrl = URL.createObjectURL(m);
                      observer.next(objectUrl);
                  });
  
              return () =&gt; {
                  if (objectUrl) {
                      URL.revokeObjectURL(objectUrl);
                      objectUrl = null;
                  }
              };
          });
      }
  </code></pre>
  
  <p>and changed my test.component.html to following </p>
  
  <pre><code>&lt;div class="dashboard"&gt;
      &lt;iframe #iframe width="100%" height="100%" style="border:none;"&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In the second scenario the iframe is loaded but the requests to css, fonts, images and other rest requests are not made so I don't get the whole grafana ui. I want to render the same grafana ui through a get request to iframe is there a way to do that in Angular 5.</p>