我需要根据表索引将行放入表中,如:
<table ng-repeat="park in parks track by $index">
<tr ng-repeat="process in processes | process.park=$parent.$index">
进程是一个对象,我需要将process.park与表的索引进行比较。
答案 0 :(得分:1)
使用$parent
为变量分配索引。
使用ng-if
验证索引
<table ng-repeat="park in parks track by $index" ng-init="parentIndex = $index">
<tr ng-repeat="process in processes" ng-if="process.park=parentIndex">