How can i include multiple js files in lazy load, so when page finished to load and angular has been executed?
I tryed with a custom directive and the code looks like: //html
<ng-lazy-load data-type="script" data-src='["file.js"]'></ng-lazy-load>
//directive
.directive('ngLazyLoad', [function () {
return {
restrict: 'E',
templateUrl:'views/modules/module_lazy_load.html',
scope:true,
link: function ($scope, element, attr) {
if(attr.type === 'script'){
$scope.src = JSON.parse(attr.src);
}
}
};
}]);
//directive view
<script ng-if="src" ng-repeat="path in src" src="{{path}}"></script>
//file.js to be included in lazy load
alert('daf***');