title: Angularjs - Save blob to a text file not working on dynamic data
body: <p>Im trying to setup a button button or anchor to download some text into a .txt file. With Jquery I do a simple $('#copy_Output_logs').text(); and my text up correctly in my console. So I setup the href link but I keep getting a blank file. To my understading, since my text is loaded dynamically on click, this wont work.</p>
  
  <p>So I created a function that would execute on click. But my anchor keeps opening a page with this weird URL <code>"http://localhost:8080/%7B%7B"</code>. Tried an alternatif way by setting un a ng-click on a button but the download dialog dosent work (which I need), it just redirects to the page with the text.</p>
  
  <p>Here's my code so far:</p>
  
  <pre><code>App.controller('Forumlaire_Controller', function ($scope, Shared_Service) {
  
      $scope.Download = function() {
          return Shared_Service.Service_download();
      } 
  
  })
  .config( function($compileProvider) {
      $compileProvider.aHrefSanitizationWhitelist(/^\s*(|blob|):/);
  });
  
  
  App.factory('Shared_Service', function($q) {
  
      return {
  
          Service_download: function() {  
              var url = $window.URL || $window.webkitURL;
              var data = $('#copy_Output_logs').text();
  
              console.log($('#copy_Output_logs').text()) // On ng-click the text showup correctly
              console.log(url.createObjectURL(new Blob([data], { type: 'text/plain' }))); //Via ng-click the url generates correctly in the console.
  
              return url.createObjectURL(new Blob([data], { type: 'text/plain' }));
  
          }
  
      }
  
  });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;a download="content.txt" href={{ Download() }} target="_blank" &gt;Download&lt;/a&gt;
  &lt;button ng-click="Download()" &gt;Alternatif&lt;/button&gt;
  </code></pre>
  
  <p>ANyone have an idea?</p>