Set URL query parameters without state change using Angular ui-router

前端 未结 3 801
清酒与你
清酒与你 2020-12-02 08:42

How should I update the address bar URL with a changing query parameter using AngularJS\' ui-router to maintain state when refreshing the page?

Currently, I am using

3条回答
  •  庸人自扰
    2020-12-02 08:56

    I was having trouble with .transitionTo until I updated to ui-router 0.2.14. 0.2.14 properly changes the location bar (without reloading the controller) using a call like this:

    $state.transitionTo('search', {q: 'updated search term'}, { notify: false });
    

提交回复
热议问题