angular.js - ui-router Is there a way to manually reload routing configuration?
世界只因有你
世界只因有你 2017-05-15 17:09:15
0
2
551


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

世界只因有你
世界只因有你

reply all(2)
迷茫

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.

滿天的星座

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template