In my AngularJS project, I am working with a JavaScript object (factory) that contains numerous functions spanning 4000 lines. Creating the object from data fetched from PHP happens pretty quickly.
$http.get('pivots/list.php')
.success(function (data) {
$scope.listOfPivots = data;
for (var i = 0; i < $scope.listOfPivots.length; i++ ) {
pivot = new pivotFactory($scope.listOfPivots[i]);
After creating the object, I need to share it with other controllers.
$rootScope.$broadcast("Update", pivot);
However, when I receive the selected object, there is a noticeable pause of a few seconds.
$rootScope.$on("Update", function(event, p) {
$scope.selectedPivot = p;
});
I would like to measure this timeout in order to display a progress bar or find ways to prevent this long delay. What steps can I take to address this issue?