Sometimes while loading the page, translateChangeSuccess
is not getting fired and its throwing error.
So, I need to call the $translateChangeSuccess
whenever the $translate is ready. How to do it in a proper way?
This is not working.It is not entering the '$translateReady' function.
$rootScope.$on('$translateReady', function () {
console.log("It enterd Translate ready"+$translate.isReady());
$rootScope.$on('$translateChangeSuccess', myfunction());
});
But if i use this funtion it is entering inside the function
$translate.onReady().then(function() {
console.log("It enterd Translate ready"+$translate.isReady());
$rootScope.$on('$translateChangeSuccess', myfunction());
});
I need to call $translateChangeSuccess
whenever it is Ready. How can I do ? If anyone knows please do help.Thanks!