Answer the question
In order to leave comments, you need to log in
How to find the previous url of the router?
Good afternoon!
There is an application written in Angular (the first one), page navigation is carried out using ngRoute. It is necessary to add a Back button ($window.history.back();), but that it would appear only if the transition was made through the pages of the application. Tried to do it by parsing $document[0].referrer but its value is always empty. How can I find out the address of the previous page that ngRoute loaded?
Answer the question
In order to leave comments, you need to log in
app.run(function ($rootScope) {
$rootScope.$on('$routeChangeStart', function (event, current, previous, reject) {
// previous
})
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question