$route.reload() does not work with ui-router

前端 未结 5 1408
北海茫月
北海茫月 2020-12-28 23:12

I\'ve switched to to ui-router. Everything went smoothly, except one thing. On my page I have a select that changes the context of the application. Anyway, previously, when

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-28 23:51

    You can do $state.reload()

    There's a bug with it sometimes not re-instantiating the controller. You can get around that with

    $state.transitionTo($state.current, $stateParams, { reload: true, inherit: true, notify: true });
    

提交回复
热议问题