简体   繁体   English

angularjs通过父索引过滤

[英]angularjs filter by parent index

I need to put rows into tables depending on table index like: 我需要根据表索引将行放入表中,例如:

<table ng-repeat="park in parks track by $index">
 <tr ng-repeat="process in processes | process.park=$parent.$index">

process is an object, and I need to compare process.park with index of table. 进程是一个对象,我需要将process.park与表的索引进行比较。

assign an index to a variable instead using $parent . 为变量分配索引,而不是使用$parent

use ng-if to validate the index 使用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">

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

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