title: Include all javascript files in a directory to a html file in angularjs? with grunt?
body: <p>In my AngularJS app, I've many controllers js files.</p>
  
  <p>These controllers (<code>one.ctrl.js</code>,<code>two.ctrl.js</code>,<code>...</code>) needs to be included in my <code>index.html</code> file.</p>
  
  <p><strong>Directory Structure:</strong></p>
  
  <pre><code>app/
     js/
        controllers/
           one.ctrl.js
           two.ctrl.js
  </code></pre>
  
  <p>Currently, above <code>js</code> files are included in <code>index.html</code> file as follows.</p>
  
  <p><strong>index.html:</strong></p>
  
  <pre><code>&lt;!--   other html components   --&gt;
  
  &lt;script src="js/controllers/one.ctrl.js"/&gt;
  &lt;script src="js/controllers/two.ctrl.js"/&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>There are gonna be more <code>*.ctrl.js</code> files which are required to be included in <code>index.html</code>.</p>
  
  <p>I need a way to automatically include all the <code>*.ctrl.js</code> files in <code>controllers</code> directory to <code>index.html</code>.</p>
  
  <p><strong>Findings:</strong></p>
  
  <p>From some SO questions,</p>
  
  <p><a href="https://stackoverflow.com/questions/22605770/load-javascript-and-css-files-in-folders-in-angularjs">Load JavaScript and CSS files in folders in AngularJS</a></p>
  
  <p><a href="https://stackoverflow.com/questions/4175008/how-can-i-include-all-javascript-files-in-a-directory-via-javascript-file">How can I include all JavaScript files in a directory via JavaScript file?</a></p>
  
  <p>I found that it cannot be done automatically and needs some server side scripting or build tools.</p>
  
  <p><strong>My Question:</strong></p>
  
  <p>Currently, I'm using <code>yeoman</code> which include <code>grunt</code> for build tool.
  So, my question is, How can those javascript files in a directory be automatically included in a html file?</p>