You can use ocLazyLoad . All you have to do is configure which page will use the files ...
If you use ui.router , lazyLoad works fine with it, here is an example of uploading files to a certain state ...
$stateProvider.state('index', {
url: "/",
views: {
"lazyLoadView": {
controller: 'AppCtrl',
templateUrl: 'partials/main.html'
}
},
resolve: {
loadMyCtrl: ['$ocLazyLoad', function($ocLazyLoad) {
return $ocLazyLoad.load('js/AppCtrl.js');
}]
}
});
ocLazyLoad documantation, , AppCtrl.js , , .
, , , , ocLazyLoad...