I tried to use the code snippet but getting the below error.
 

0x800a138f - JavaScript runtime error: Unable to get property '$apply' of 
undefined or null reference


Below is the code where I have used

eBillingModule.config(["$provide", function ($provide) {

$provide.decorator('$rootScope', function ($delegate) {

var digest = $delegate.$digest;

$delegate.$digest = function () {

console.log('Digest on scope ' + this.$id + ' started');

console.time(this.$id + ' - $digest');

if (digest != null)

{

digest.apply(this, Array.prototype.slice.call(arguments));

}

else

{

console.log('digest in null');

}

 console.timeEnd(this.$id + ' - $digest');

};

});

}]);


On Wednesday, April 9, 2014 3:40:52 PM UTC-5, s veerapally wrote:

> I am trying to find out the total time that page is taking to render.  We 
> have to log the time from desktop browsers and as well as from mobile 
> browsers to the database. So using developer tool bars like Chrome or IE 
> f12 may not be feasible.  I have tried using '$viewContentLoaded' with 
> something like this within the controller.
>
> $scope.$on('$viewContentLoaded', { log.timeEnd('timelogger'); });
>
> But this method is called even before the angular custom directive is 
> being executed. I am not sure if I am doing something wrong.
> Thanks,
>  s veerapally
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to