I am currently working on developing a Single Page Web Application that will require user/password protection. Specific modules will be loaded based on the user's profile to restrict access in a role-based manner.
For loading templates corresponding to the user ID, I am utilizing ng-view
.
My question is: How can I selectively load the JavaScript file of the template's controller?
<script script src="restrictetd/path/MyAngularControl.js"></script>
If a user does not have access to a specific template, there is no need to download its corresponding JavaScript file.
Any advice on this matter would be greatly appreciated.