我正在通过 ng-view 内的角度路线加载 html 页面。
我正在加载的页面包含一个 ng-include 标签,指向
另一个 html 文件。
我尝试了以下所有语法=
<div ng-include src="'some.jsp'"></div>
<div ng-include="'login.jsp'"></div>
<div ng-include src="include.url"></div>
不工作。但是如果我将相同的标签放在 ng-view 之外
工作正常。
我究竟做错了什么?
文件的 url 应与您的 index.html(主 html 文件)相关。
如果你的结构是这样的:
index.html
template
template1.html
template2.html
在 template1 中你想要 ng-include template2.html,
你应该做
<div ng-include="'template/template2.html'"></div>
Here http://plnkr.co/edit/jMLWOxZl2wgNs1oPjnhZ?p=preview是一个工作示例。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)