草庐IT

urlRouter

全部标签

javascript - ui-router deferIntercept 和状态参数

我使用ui-router的新deferIntercept()来更新浏览器url而无需重新加载我的Controller:$rootScope.$on('$locationChangeSuccess',function(e,newUrl,oldUrl){e.preventDefault();if($state.current.name!=='search'){$urlRouter.sync();}$urlRouter.listen();});使用此代码,单击浏览器的后退按钮会将URL更改为上一个,但我无法更新我的Controller状态以反射(reflect)此更改。$stateParam