title: window.URL.createObjectURL [Angular 7 / Typescript]
body: <p>I've to show/download a .pdf file in my Angular 7 project but I'm having some troubles with window.URL.createObjectURL.
  This is what I made:</p>
  
  <pre><code>this.userService.getFile(report.id).subscribe(
    res =&gt; {
      console.log(res)
      const filename = res.headers.get('content-disposition').split(';')[1].split('=')[1].replace(/\"/g, '')
      const blob = new Blob([res.body], { type: res.body.type })
      const url = window.URL.createObjectURL(blob)
      const a: HTMLAnchorElement = document.createElement('a') as HTMLAnchorElement
  
      a.href = url
      a.download = filename
      window.document.body.appendChild(a)
      a.click()
      window.document.body.removeChild(a)
      URL.revokeObjectURL(url)
    },
    err =&gt; {
      console.log(err)
    }
  </code></pre>
  
  <p>where getFile() is a simple http request</p>
  
  <pre><code>getFile(fileId: string): Observable&lt;any&gt; {
     return this.http.get(environment.API_URL + '/file/' + fileId, {observe: 'response', responseType: 'blob'})
  }
  </code></pre>
  
  <p>My IDE is also firing a 'Instance member is not accessible' on window.URL.<strong>createObjectURL</strong>()</p>
  
  <p>File seems to be fetched from server and from console I can see the debug print 'Navigate to blob://' but then download prompt does not shows up.</p>
  
  <p>I've used the same approach in another Angular project (but version 6) and it works nice, I can't understand why now is not working anymore.
  Any suggestion? </p>
  
  <p>Thank you!</p>