简体   繁体   English

在AngularJS中使用路由最简单的工作示例是什么?

[英]What is the simplest working example with routes in AngularJS?

I have found several examples with Routes and Angular and sadly none of them worked, including the "official" guide example (clicking there gets wrong URL which does not work upon reload). 我发现了一些使用Routes和Angular的示例,但不幸的是它们都不起作用,其中包括“官方”指南示例 (单击此处将得到错误的URL,重新加载后将不起作用)。

  • Is there any simple working example with correct URL updates that work upon reload? 是否有任何简单的工作示例,其中包含正确的URL更新,这些更新在重新加载后就起作用了?

  • Is there any such example with tabs? 是否有这样的带有制表符的示例?


EDIT. 编辑。 I've managed to making routes working by removing $locationProvider.html5Mode(true) . 我设法通过删除$locationProvider.html5Mode(true)使路由正常工作。 If enable, it produced corrupted URLs in my browser (I use Chrome 31.0.1650.63 with Mac OS 10.8.5) 如果启用,它将在我的浏览器中生成损坏的URL(我在Mac OS 10.8.5中使用Chrome 31.0.1650.63)

This is exactly what I was looking for: 这正是我想要的:

http://angular-ui.github.io/ui-router/sample/ http://angular-ui.github.io/ui-router/sample/

Perfect and functional! 完美而实用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM