I have an angularjs app. In the html page I call some REST services when the page is loading. I want to calculate the time taken in loading the page.
I found below code at Calculating Page Load Time In JavaScript:
window.onload = function () {
var loadTime = window.performance.timing.domContentLoadedEventEnd-window.performance.timing.navigationStart;
console.log('Page load time is '+ loadTime);
}
But it uses window.onload.
Which angularjs directive should I use to execute this logic after the page load is done.
Thanks.