There are three pages. Page A, B, C. When I go to page A, I want to know which page I came from, page B or C?
I haven't been able to find a solution for several hours now.
CodePudding user response:
router.events.forEach((event) => {
console.log(event);
});
You can refer this thread for more info How to determine previous page URL in Angular?