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&center',             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&center=1,2. bunch operation in page, url becomes http://www.example.com/index?zoom=12&center=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

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -