title: View blob response as image in angular
body: <p>I am trying to get a blob response from a request, and then generate a URL from that blob and set this URL as an image's source.</p>
  
  <p>But the image is not loading. </p>
  
  <p>This is my HTML:</p>
  
  <pre><code>&lt;img src="{{previewSignsrc}}" alt="Sign Thumbnail"&gt;
  </code></pre>
  
  <p>And this is my <code>.ts</code> file:</p>
  
  <pre><code>this.signModalDataService.getPreviewSignature({'name': this.SignatureName, 'font_type': 0});
      this.signModalDataService.previewSignature
        .subscribe((res) =&gt; {
          console.log(res);
          let blob = new Blob([res['_body']], {type: 'image/png'});
          this.previewSignsrc = URL.createObjectURL(blob);
          this.showPreviewSign = true;
        });
  </code></pre>
  
  <p>I used same method to set <code>url</code> for <code>ng2-pdfviewer</code> and it worked fine.</p>