AngularJs: How to check whether a hyperlink is loaded fully and then perform next action
AngularJs: How to check whether a hyperlink is loaded fully and then perform next action
Question is simple I just want to check whether the hyperlink is loaded fully or not inside the ng-click event.
HTML:
Click me
JS:
$scope.clicked= function() {
window.location='https://firstlink.com';
//
//when above wesbite page is fully loaded then go to below code and load the next link
//
window.location='https://secondlink.com';
}
NOTE:
I don't want to check whether the view is loaded or not, I want to check whether the URL is completely loaded or not.
I've checked many articles and posts regarding this but all I'm getting is that how to check whether your angularjs application is loaded or not. I want to get an approach with which I can check that these URLs are loaded fully or not.
Below are some questions I already gone through:
Post render call for AngularJs
Execute AngularJs controller function on page load
Sending event when angularjs finished loading
Angularjs event to call after content is loaded
1 Answer
1
Use the angular.element
to wait till page loaded
angular.element
$scope.clicked= function() {
window.location='https://firstlink.com';
//
//when above wesbite page is fully loaded then go to below code and load the next link
//
angular.element(function () {
window.location='https://secondlink.com';
});
}
which angular version are u using
– Sachila Ranawaka
Jun 29 at 11:18
angularjs v 1.6
– Tk1993
yesterday
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
It's not working my friend.
– Tk1993
Jun 29 at 11:17