如何禁用angularjs路由? [英] How to disable routing in angularjs?

查看:191
本文介绍了如何禁用angularjs路由?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有真的只是具有一个单页单页的应用程序。这里只有拥有大量的JavaScript / AJAX逻辑与angularjs做了一个视图,但没有路由涉及的其他意见。

I have a single page application that really just has one single page. There's just the one view that has lots of javascript/ajax logic done with angularjs, but there's no routing to other views involved.

所以我想摆脱的git在URL的末尾hashbang(#/)的。我能以某种方式关闭angularjs路由完全?

Therefore I'd like to git rid of the hashbang (#/) at the end of the url. Can I somehow turn off angularjs routing completely?

顺便说一句:我知道Htm5Mode,但我想它在所有的浏览器

Btw: I know about Htm5Mode, but I want it to work in all browsers.

推荐答案

如果你没有一个 $ routeProvider 中定义的,不会有任何路由,因此没有散列您的网址。

If you don't have a $routeProvider defined, there will be no routing, and therefore no hash in your url.

这篇关于如何禁用angularjs路由?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆