问题
I need to filter ng-repeat on value of ng-model Like this :
<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>
My problem is it's seems that the filter rate.activity.uuid: planning.activity.uuid
doesn't works.
Please what is the good way ?
回答1:
Change your filter to
<td ng-repeat="rate in registration.rate | filter: {activity : {uuid: planning.activity.uuid}} :true">
{{rate.type.label}}
</td>
来源:https://stackoverflow.com/questions/33996751/filter-on-ng-repeat-with-ng-model-value