使用ng-model值过滤ng-repeat

时间:2015-11-30 10:45:06

标签: angularjs ng-repeat

我需要对ng-model的值进行ng-repeat过滤 像这样:

 <select class="browser-default" ng-model="planning.uuid" id="planning" ng-options="planning.uuid as planning.day for planning in plannings" ng-change="loadRegistration(planning.uuid)">
      <option value="" disabled selected>Planning</option>
 </select>
...
<table...
   <tr ng-repeat="registration in registrations" >
     <td ng-repeat="rate in registration.rate | filter: rate.activity.uuid: planning.activity.uuid">
          {{rate.type.label}}
     </td>
  </tr>
</table>

我的问题是过滤器rate.activity.uuid: planning.activity.uuid似乎不起作用。

请问有什么好办法?

1 个答案:

答案 0 :(得分:2)

将过滤器更改为

 <td ng-repeat="rate in registration.rate | filter: {activity : {uuid: planning.activity.uuid}} :true">
      {{rate.type.label}}
 </td>