且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Angular/UI-Router - 如何在不刷新所有内容的情况下更新 URL?

更新时间:2023-08-25 13:36:04

您使用的代码片段与正确的 ui-router 设置相差甚远.我建议你,检查这个演示应用程序:http://angular-ui.github.io/ui-router/sample/#/contacts/1.在这里我们可以看到 List 是如何固定"的,而 Detail 是如何在没有任何页面刷新的情况下更改的.

The code snippets you've used are a bit far from the correct ui-router settings. I would suggest to you, check this demo application: http://angular-ui.github.io/ui-router/sample/#/contacts/1. Here we can see how the List is "fixed" while Detail is changed without any page refresh.

这个例子的代码在这里下载https://github.com/angular-ui/ui-router/tree/master/sample.

The code of this example download here https://github.com/angular-ui/ui-router/tree/master/sample.

什么对理解 HOW TO 有很大帮助(除了 wiki) 是这个代码片段:state.js.加载演示,通读此注释说明.而 ui-router 会有意义...

What should help a lot to understand HOW TO (except the wiki) was this code snippet: state.js. Load the demo, read through this commented explanation. And ui-router will make sense...