rross
rross

Reputation: 2276

AngularJS resource management

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

Answers (1)

Philipp Gayret
Philipp Gayret

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

Related Questions