繁体   English   中英

如何在角度的ng-include内容中注入ng-repeat循环变量

[英]How to inject ng-repeat loop variable in ng-include content in angular

我想建立两个具有相同记录结构的表。 一个表是Main,另一个表是Archiv。 记录是具有col-sm-x结构的引导div,其中包含{{rec.Name}},{{rec.Age}}等。从记录内容中,我制作了一个tablerecord.html模板,我想在两种不同的情况下使用ng-repeat建立表格。

<div> ng-repeat="rec in MainTable"><record_template/></div> 
and
<div> ng-repeat="rec in Archiv""><record_template/></div>

为了加载记录模板,我使用了角度指令“ recordTemplate”。 如何在record_template中注入“ rec”变量?

提前致谢。

    As i don't know how you written your directive. you can check the below link.

    http://jsbin.com/gopula/1/edit?html,js,output

and try this 

<div> ng-repeat="rec in MainTable" record_template ="rec"/></div> 
and
<div> ng-repeat="rec in Archiv" record_template="rec"/></div>

    Hope this will help you 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM