0

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?

rross
  • 2,236
  • 11
  • 36
  • 41

1 Answers1

1

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. )

Community
  • 1
  • 1
Philipp Gayret
  • 4,870
  • 1
  • 28
  • 34