search

Home  >  Q&A  >  body text

angular.js - How is the will appear event of the page implemented in angular?

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?

黄舟黄舟2780 days ago513

reply all(1)I'll reply

  • 習慣沉默

    習慣沉默2017-05-15 16:55:21

    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.

    reply
    0
  • Cancelreply