Angular/UI-Router - How Can I Update The URL Without Refreshing Everything?

后端 未结 2 1186
谎友^
谎友^ 2020-11-27 06:42

I\'m new to both Angular and the ui-router. When someone selects a model and my controller performs a standard SHOW method, I simply want to update the URL to include the m

相关标签:
2条回答
  • 2020-11-27 07:37

    In essence, what you want to do is not to put the city code in the ui-view and/or not to use a template with this view. As a result, none of the DOM will get changed but the URL will. This is discussed more fully on Angular-ui.router: Update URL without view refresh

    0 讨论(0)
  • 2020-11-27 07:40

    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.

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

    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...

    0 讨论(0)
提交回复
热议问题