How to implement first DOM load then angularJs function execute
HI i am facing some problem that first angularjs function execute then View DOM load.. so how to fix this issue.. alternatively i have used below code---
app.run(["$rootScope", "$location","$window", function ($rootScope, $location,$window) { $rootScope.$on("$routeChangeSuccess", function (userInfo) { //console.log(userInfo); angular.element(document).ready(function () { setTimeout(function () { var windowHeight = $(window).height() - 100; $('#page-layout').css({ 'overflow-x': 'auto', 'max-height': windowHeight }); }, 1000); $(window).resize(function () { var windowHeight = $(window).height() - 100; $('#page-layout').css({ 'overflow-x': 'auto', 'max-height': windowHeight }); });
});
});
$rootScope.$on("$routeChangeError", function (event, current, previous, eventObj) {
if (eventObj.authenticated === false) {
$location.path("/Login");
}
});
}])
Hey Santosh, you probably meant to post this somewhere else?
Let me know if we can close this...
Thanks, Mark
yes you can