title: how to download a file in angularjs controller
body: <p>I want to download a file on button click in angularjs</p>
  
  <pre><code> &lt;button ng-click=downloadfile()&gt;download&lt;/button&gt;
  </code></pre>
  
  <p>In controller</p>
  
  <pre><code>  $scope.downloadfile=function()
          {
              //
          }
  </code></pre>
  
  <p>which functionality i have to write in downloadfile function could you please explain</p>