Reputation: 2276
I'm including several items for my Angular app.
<script src="js/app.js"></script>
<script src="js/oneCtrl.js"></script>
<script src="js/twoCtrl.js"></script>
<script src="js/threeCtrl.js"></script>
<script src="js/oneSvc.js"></script>
<script src="js/twoSvc.js"></script>
<script src="js/threeSvc.js"></script>
etc...
Are all those files loaded into memory at page load or does angular manage loading those resources into memory as needed?
Upvotes: 0
Views: 567
Reputation: 5070
If you define them as script tags, your browser will load them all, Angular has no control over this. If you want a system where you conditionally load scripts you should look at RequireJS / AMD. ( Maybe RequireJS with AngularJS might be what you're looking for. )
Upvotes: 1