I have built many angular applications, and each time I try to improve app performance , architecture .. etc.
One strategy some people follow is to concatenate all JavaScript files in one minified file, and also all stylesheet files in one minified file, this however opposes with lazyload concept, for example angular oc lazyload loads state files in this manner:
//inject dependency
var myApp = angular.module("MyApp", ["oc.lazyLoad"]);
//load file
myApp.controller("MyCtrl", function($ocLazyLoad) {
$ocLazyLoad.load('testModule.js');
});
The question is which pattern will provide better performance concatenation or lazy loading ?