Change route parameters without updating view

后端 未结 3 1781
温柔的废话
温柔的废话 2020-12-24 14:16

I\'m currently trying to figure out how to change the route parameters without reloading the entire page. For example, if I start at

http://www.example.com/#/page

3条回答
  •  被撕碎了的回忆
    2020-12-24 14:36

    You can change the display of the page using ng-show and ng-hide, these transitions won't reload the page. But I think the problem you're trying to solve is you want to be able to bookmark the page, be able to press refresh and get the page you want.

    I'd suggest implementing angular ui-router Which is great for switching between states without reloading the page. The only downfall is you have to change all your routes.

    Check it out here theres a great demo.

提交回复
热议问题