I want to execute a method (such as refreshing the page data) every time page A is about to be displayed. How should I implement this?
PS: The function in the controller is only called when the page is created. It will not be called when returning to this page again?
You can use the
resolve
option of routing to solve the operation you want to perform, and the returned data can be injected into the controller.