title: How to create and save file to local fileSystem using AngularJS?
body: <p>I want to create and save file before I log data into it. The method below is creating and saving data to file and it is only supported by Chrome browser. How can I create and save blank file and then log data into it and has IE and Chrome support?</p>
  
  <p>ctrl.js:</p>
  
  <pre><code>function download(text, name, type) {
      var a = document.getElementById("a");
      var file = new Blob([text], {type: type});
      a.href = URL.createObjectURL(file);
      a.download = name;
  }
  $scope.recordLogs = function(){
      download('file text', 'myfilename.txt', 'text/plain')
  }
  </code></pre>