Throughout my experience building multiple angular applications, I have continuously strived to enhance app performance and architecture.
One common strategy for improving performance is to concatenate all JavaScript files into one minified file, as well as combining all stylesheet files into another minified file. However, this approach contradicts the lazy loading concept. For instance, Angular's oc lazyload loads state files in a different manner:
//inject dependency
var myApp = angular.module("MyApp", ["oc.lazyLoad"]);
//load file
myApp.controller("MyCtrl", function($ocLazyLoad) {
$ocLazyLoad.load('testModule.js');
});
The debate arises: which approach will ultimately lead to better performance - concatenation or lazy loading?