当前位置: 移动技术网 > IT编程>脚本编程>AngularJs > AngularJS删除路由中的#符号的方法

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

2018年05月10日  | 移动技术网IT编程  | 我要评论

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

例如:

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

需要改成

http://example.com/
http://example.com/about
http://example.com/contact

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

$locationprovider.html5mode(true);

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

<base href="/">

以上所述是小编给大家介绍的angularjs删除路由中的#符号的方法,希望对大家有所帮助

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网