angularjs路由删除#符号解决的办法
最近做一个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);
然后再index.html 的header中,指定一个base:
<base href="/" rel="external nofollow" >
这就ok了,需要的通知自己尝试一下吧!
相关推荐:
angularjs仿微信图片手势缩放代码
angularjs使用ui-route实现多层嵌套路由
angularjs用户登录问题处理
以上就是angularjs路由删除#符号实例分享的详细内容。
