-1

Consider the below

<html ng-app="crudModule">
@{
    ViewBag.Title = "Index";
}

<body ng-controller="crudController">
    <table id="tblContainer" border="1">
        <thead>
            <tr>
                <th>EmpName</th>                
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="emp in Employees" my-employee="emp"></tr>
        </tbody>
    </table>
    <script type="text/ng-template" id="Employee.html">
        <tr>
            <td> <span>{{_employee.EmployeeId}}</span></td>            
        </tr>
    </script>   
</body>
</html>
<script src="~/Scripts/angular.js"></script>
<script src="~/Scripts/angular-route.js"></script>
<script src="~/Scripts/MyScripts/Module.js"></script>
<script src="~/Scripts/MyScripts/Service.js"></script>
<script src="~/Scripts/MyScripts/Controller.js"></script>
<script src="~/Scripts/MyScripts/Builder.js"></script>
<script src="~/Scripts/MyScripts/Utility.js"></script>

A lot of external javascript files in the same page.

Is there any nice way to do it so that the page will have only one JS file and the others will be inside that or any other way?.

priyanka.sarkar
  • 25,766
  • 43
  • 127
  • 173
  • You can use a service like [grunt-contrib-concat](https://github.com/gruntjs/grunt-contrib-concat). First you would have install `node` and then `grunt`, but the benefits of this are huge. – KJ Price Mar 31 '15 at 17:55
  • Check out requirejs @ http://requirejs.org - I've never used it but it sounds like what you're looking for – barbiepylon Mar 31 '15 at 17:55

1 Answers1

0

This is asp.net / mvc use script bundling. See

http://www.asp.net/mvc/overview/performance/bundling-and-minification

Thanks

Steve Drake
  • 1,968
  • 2
  • 19
  • 41
  • note, I would not have suggest this if it was not for the MVC code in the example. As your using MVC there is nothing wrong with taking advantage of its framework. – Steve Drake Mar 31 '15 at 18:25