title: angular: show a loading bar while downloading a file
body: <p>i am building my first site using angular and i encountered a problem of how to show loading bar when downloading a file.</p>
  
  <ol>
  <li>User clicks on a download link</li>
  <li>Client displays a "Loading..." message</li>
  <li>Client sends a request to server for generating and returning the file. </li>
  <li>Server returns the dynamically generated file to the client</li>
  <li>Client hides the "Loading..." message</li>
  <li>Client starts to download the file</li>
  </ol>
  
  <p>I tried:</p>
  
  <pre><code> $scope.download= function () {
          $scope.showLoading = true; 
          var url = 'http://localhost:9000/download?file=myfile';
  
          $http.get(url).success(function (data) {
              $scope.showLoading = false;
              // what to do with data(file)?
          });              
      }
  </code></pre>
  
  <p>how I can save the the file(data) using angular?</p>