我正在尝试在以下内容中动态加载模板ng-repeat
:
<ul>
<li ng-repeat="prop in entity" >
<div ng-include src="prop.template"></div>
</li>
</ul>
prop.template
等于模板的 URL,例如'partials/form/text.html'
. 上面的代码产生以下错误:
Error: 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [["prop.template; newVal: \"partials/form/text.html\"; oldVal: undefined","prop.template; newVal: \"partials/form/text.html\"; oldVal: undefined" .... (and so on)
如何prop.template
从该文件中获取模板的 URL 并将 HTML 插入到 DOM 中ng-repeat
?