简体   繁体   English

AngularJS Routing Link在Chrome中不起作用

[英]AngularJS Routing Link does not work in Chrome

I have the following HTML to route to a different view: 我有以下HTML可以路由到其他视图:

<a href="#/Contacts/Create" onclick="hideCancas();">Contact</a>

The route works perfectly fine on Firefox, but gives the following error on Chrome/Safari: 该路由在Firefox上运行正常,但在Chrome / Safari上出现以下错误:

GET http://localhost:55951/Contacts/Create 404 (Not Found)

It looks like WebKit is trying to actually go to the address, whereas in Moz there is no navigation, and AngularJs is handling the routing. 看起来WebKit试图实际到达该地址,而在Moz中没有导航,而AngularJs正在处理路由。

Any ideas what would be causing this? 有什么想法会导致这种情况吗?

For any novice AngularJs developer who stubles upon this problem like I did: 对于像我一样顽固解决此问题的任何新手AngularJs开发人员:

After lots of head banging, I read the console log carefully, which had a reference to jQueryMobile.js. 经过大量的敲打之后,我仔细阅读了控制台日志,其中提到了jQueryMobile.js。 Turns out jQueryMobile does not play nice with Angular.Js. 事实证明,jQueryMobile在Angular.Js中表现不佳。

You can do a workaround with http://jacobmumm.com/2011/08/30/angularjs-with-jquery-mobile/ . 您可以使用http://jacobmumm.com/2011/08/30/angularjs-with-jquery-mobile/来解决。 I just ended up removing jQueryMobile. 我刚结束删除jQueryMobile。

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

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