title: How to Save an XML File in Angular2 in the file system
body: <p>I can receive the XML File using HTTP get method and pass it as a Blob.
  I can't use the window.open method as it opens the XML file in the web browser.</p>
  
  <p>I know there is a <strong><em>FileSaver</em></strong> component for AngularJS but it does not work in Angular2.</p>
  
  <p>Please Help</p>
  
  <p>This is my service call.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>public downloadXMLFile(): Promise&lt;Blob&gt; {
      return this.http.get('this.downloadURL').toPromise()
        .then((r: Response) =&gt; new Blob([r.text()], {type: 'application/xml'}))
        .catch(error =&gt; console.log(error));
  }</code></pre>
  </div>
  </div>
  </p>