AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > JavaScript

AngularJS删除路由中的#符号的方法

51自学网 http://www.wanshiok.com
angularjs,路由

最近做一个web应用,有个需求需要删除angular路由中的#号。

例如:

http://example.com/http://example.com/#/abouthttp://example.com/#/contact

需要改成

http://example.com/http://example.com/abouthttp://example.com/contact

这个是angular默认自带的,所以想要删除需要配置一下:

$locationProvider.html5Mode(true);

然后再index.html 的header中,指定一个base:

<base href="/">

以上所述是小编给大家介绍的AngularJS删除路由中的#符号的方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对wanshiok.com网站的支持!


angularjs,路由  
上一篇:jQuery图片前后对比插件beforeAfter用法示例【附demo源码下载】  下一篇:jQuery实现输入框邮箱内容自动补全与上下翻动显示效果【附demo源码下载】