路由中使用函数来配置templateUrl,但是用户经过某个操作后,template需要指向不同的值,这时候只有在刷新页面的时候才会获得新的template,请问如何在 ui-sref=“”的时候,和在控制器中让这个路由重新配置一边,执行reurl函数呢?在不刷新整个页面的前提下;
试了一下 ui-sref-opts="{reload:'user.result'}" 无效 不能重新定义templateurl
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.
$state
Although violence is not elegant, it can solve your problem
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