title: Angular 2 download file from rest service
body: <p>I have Angular 2 client that download a file from rest service:</p>
  
  <pre><code> downloadAPK(projectName: string): void {
      this.projectService.downloadAppFile(projectName).subscribe(blobContent =&gt; {
          var a = document.createElement("a");
          a.setAttribute('style', 'display:none;');
          document.body.appendChild(a);
          var url = window.URL.createObjectURL(blobContent);
          a.href = url;
          a.download = projectName + '.apk';
          a.click();
      });
  
  }
  </code></pre>
  
  <p>The Client code:</p>
  
  <pre><code>&lt;div class="subTitleStatus"&gt;Ready 
      &lt;a style="cursor:pointer" (click)="downloadAPK(project.name)"&gt;&lt;i class="glyphicon glyphicon-download-alt"&gt;&lt;/i&gt;&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The Service code:</p>
  
  <pre><code>downloadAppFile(projectName: String): any {
      return this._http.get(this._productUrl + "/downloadAppFile/" + projectName,
          {responseType: ResponseContentType.Blob})
          .map(res =&gt; res.blob())
          .catch(this.handleError);
  }
  </code></pre>
  
  <p>The problem is that the user does not have any indication that the download started until the client finish downloading the file.
  i'm talking about huge files </p>
  
  <p>how can i change the client code to show downloading percentage when the user click the download link until finish downloading?</p>
  
  <p>Thanks</p>