nginclude添加/主网址 [英] nginclude add / to the main url

查看:175
本文介绍了nginclude添加/主网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何想法,为什么会这样?

Any idea why this is happening?

我尝试使用

ng-include="'html_template'"

URL结果的 NG-包括

http://localhost/app/grid#/leave

URL结果的 NG-包括

http://localhost/app/grid#leave  

注意,正斜杠/添加。

Notice that the forward slash "/" is added.

推荐答案

其实,有问题,并回答有关

Actually there is question and answer about that

<一个href=\"http://stackoverflow.com/questions/23299966/$p$pserve-traditional-anchor-behavior-with-ng-include\">$p$pserve与传统的锚行为NG-包括

在这个问题的答案的总结,NG-包括需要$ anchorScroll和$ anchorScroll需要$位置。只要$位置参与,它改变了正常的哈希角度不是招

In summary of that answer, ng-include requires $anchorScroll, and $anchorScroll requires $location. As long as $location is involved, it changes the normal hash to angular hasn

这就是我的回答对你有同样的问题, http://stackoverflow.com/a/27529032/454252

This is my answer to the same problem you have, http://stackoverflow.com/a/27529032/454252

基本上角度变化与URL NG-包括因为$位置服务是参与的方式,以及解决是有点棘手

Basically Angular changes the URL with ng-include because $location service is involved, and the way get around is little tricky

这篇关于nginclude添加/主网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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