search

Home  >  Q&A  >  body text

angular.js - ui-router Is there a way to manually reload routing configuration?


A function is used in routing to configure the templateUrl, but after the user performs a certain operation, the template needs to point to a different value. At this time, the new value will only be obtained when the page is refreshed. template, how can I let this route reconfigure in the controller and execute the reurl function when ui-sref=""? Without refreshing the entire page;

I tried ui-sref-opts="{reload:'user.result'}" but it doesn’t work. Templateurl cannot be redefined

世界只因有你世界只因有你2819 days ago570

reply all(2)I'll reply

  • 迷茫

    迷茫2017-05-15 17:11:15

    It seems that routing cannot be reconfigured. You can pass the parameters in your reurl to the controller, and different pages can be displayed and hidden in the controller.

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-15 17:11:15

    Thanks for the invitation.
    It can be changed again.

    You try to inject it$state into the controller, and then you can see that there is a routing table in it, and you can just change the data in it.

    Although violence is not elegant, it can solve your problem

    reply
    0
  • Cancelreply