When i visit one route and then go to another, is where a way to know which route i came from?
I tried document.referrer – this doesn’t work. Googling hadn’t brought any answers either..
I set up this fiddle for example and testing..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no direct solution using the API. Meaning, this information is not part of the public API.
However, you can cache this information yourself.
Use “setupController”, rather than “enter”, because when you transition from /users/1 to /users/2 for instance, the enter/exit methods are not executed, whereas the setupController gets executed every time (and is part of the public API).
You should refine it if you have nested routes, because this will add the intermediate routes as well. But for your example, it works well.