Chr*_*son 8 angularjs angularjs-ng-include
我有一个插入的模板,ng-include该模板也有一个ng-include.内部ng-incude没有显示.为什么?
主要模板:
<div ng-include src="'views/outer.html'"></div>
Run Code Online (Sandbox Code Playgroud)
意见/ outer.html:
<div ng-repeat="item in items">
// Stuff
<div ng-include src="'views/inner.html'"></div> // not being shown
// More stuff
</div>
Run Code Online (Sandbox Code Playgroud)
您发布的代码应该可以工作,因此问题可能位于其他地方。
原因之一可能是在其他地方抛出了 JavaScript 错误,或者在范围内找不到任何项目。请务必检查浏览器控制台。
为了您的方便,这里是代码的工作版本:
http://plnkr.co/edit/pCTInrtITqHraC1hPyZH?p=preview
希望有帮助!