Search code examples
javascriptangularjshtmlcleaner

Putting list of AngularJs scripts out of HTML codes


I have a long list of controllers, services, factories, directives,etc files and I dont want to use this long list of <script> inside the head or body of the HTML. Is there anyway to put them somewhere, that my codes look more clean?


Solution

  • If it's inline scripts, put all code in external js file and use that.

    If you are including lot of js files(even though its just fine to do so), use a build tool like Grunt to concatenate all the js files if you dont want too many of them. They will put all the code in one js file which you can include at the end.