Reputation: 3986
I am trying to use browser back button to navigate to last page accessed by user. In Jquery i can use below code.
function onBackKeyDown() {
history.go(-1);
navigator.app.backHistory();
}
I want to achive the same by Angular. But i am very new to angular so, looking for advise.
Thanks
Upvotes: 0
Views: 205
Reputation: 7739
Try this
function onBackKeyDown() {
history.go(document.referrer);
navigator.app.backHistory();
}
document.referrer
will give you last url.
Upvotes: 1