title: Angular - Save blob in local text file?
body: <p>I have a plain text variable which I want to store and save on a <code>.txt</code> file using Angular.</p>
  <p>So far I have tried the following:</p>
  <pre><code>var data = new Blob([text], {type: 'text/plain'});
  const url= window.URL.createObjectURL(data);
  window.open(url);
  </code></pre>
  <p>Being <code>text</code> the variable with the plain text content. It seems to work but it opens de blob on a new browser tab, and I need it to be downloaded as <code>whatever.txt</code>.</p>
  <p>How can I achieve this? Thanks!</p>