How to Get an Embarrassingly Long Load Time
Those Dag Nabbit Asyncronous Calls
$timeout to the Rescue!
angular .module('MyApp') .controller('SubheaderAppCtrl', function($timeout) { loadMasterJson(); function loadMasterJson() { // Code to do async calls goes here.
And here's the speedy new hotness:
angular .module('MyApp') .controller('SubheaderAppCtrl', function($timeout) { $timeout(function(){ loadMasterJson(); }); function loadMasterJson() { // Code to do async calls goes here.
It's pretty amazing, but putting your async calls in this $timeout block will allow the page to finish rendering which makes it seem much snappier and prevents weird partial-renderings. It's important to note that this doesn't speed up the actual loading of the JSON files, and since it will take some time after the DOM renders you will probably want to put a loading spinner or some other loading indicator in the empty area that will display the data in the JSON files (if you have a visible area like that, of course).