Is there a global routing method like ng1's $stateChangeSuccess, in ng5?

now the company has a requirement, a table page. When you click on add a piece of data, jump to the new form page. After adding, jump back to the table page and revert to the state before the table page. For example, the table page, in the table pagination, browse on page 5, then when added, jump to the table page is still on page 5.

now you need to determine whether the table page came directly from the menu or jumped back after adding it. Ng1 has a global event $rootScope.$on ("$stateChangeSuccess", function (event, toState, toParams, fromState, fromParams) ). You can determine the source page by fromState . Does ng5 have such an event? If not, how to achieve similar functions in general?

Apr.05,2021
Menu