I'm pretty new in the AngularJs world and I'm trying to follow some good practices. In some pages of an app I'm programming, there are some scripts (jquery plugins I'm wrapping in directives) I'll be using in some pages. These same scripts won't be needed in site locations.
I'm wondering if it's ok to include these scripts right into the template:
<table id="grid">
<tr>
<th>Foo</th>
</tr>
<tr ng-repeat="lorem in lorems">
<td>{{lorem.text}}</td>
</tr>
</table>
<script src="assets/plugins/jQGrid/jQGrid.min.js"></script>
This way, the script would be included only when this specific directive is called. Off course, I can include it into the boostrap .html file, but the script would be allocated in memory even in those cases it's not needed.
I'm trying achieve some kind of lazy loading here.
Any ideas would be nice.