javascript - Reload page on browser back/forward button in AngularJS with ui router -
i have following config ui router state in angularjs app.
$locationprovider.html5mode(true); $stateprovider .state('index', { url: '/index?zoom¢er', views: { 'map': { controller: 'mapctrl', templateurl: 'map.html' } }, reloadonsearch:false });
however, forward button in browser go different url, need reload page urls stateparams.
for example: user1 go page http://www.example.com/index?zoom=2¢er=1,2. bunch operation in page, url becomes http://www.example.com/index?zoom=12¢er=3,4
then presses button, url changes previous one, need reload page let controller read query parameters right thing...
any way let work browser back/forward?
have tried setting reloadonsearch
true? if doesn't suite needs, perhaps check out question: force angularjs reload route although option reloadonsearch set false
a simpler alternative may force reload window.location = newurl whenever necessary.
Comments
Post a Comment