我需要对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
似乎不起作用。
请问有什么好办法?
答案 0 :(得分:2)
将过滤器更改为
<td ng-repeat="rate in registration.rate | filter: {activity : {uuid: planning.activity.uuid}} :true">
{{rate.type.label}}
</td>