I have implemented the script below:
$rootScope.$on('$includeContentLoaded', function (eve,uri) {
var js = document.createElement("script");
js.type = "text/javascript";
js.src = '/assets/js/scripts.js';
document.body.appendChild(js);
});
However, the script is being appended multiple times based on how many times I use ng-include in my app. How can I ensure the script is included only after the entire page has loaded?