I want to pass two argument to the custom filter 'from' and 'to' into the custom filter I have created in my controller.
Here you can see my custom filter I have created:
vm.filterMinutes = function (prop, from, to) {
return function (item) {
return item[prop] >= from && item[prop] <= to;
};
};
And the view looks like this:
<label>Search from: <input ng-model="fromMinutes"></label>
<label>Search from: <input ng-model="toMinutes"></label>
<tr style="cursor: pointer;" ng-repeat="student in AdminReportsWorksnaps.data | filter: AdminReportsWorksnaps.filterMinutes('totalMinutes', fromMinutes,toMinutes)">
<td>{{ student.studentId }}</td>
<td>{{ student.firstName }}</td>
<td>{{ student.lastName }}</td>
<td>{{ student.municipality }}</td>
<td class="total success">{{ student.totalMinutes | number}}</td>
</tr>
For some reason this is not working.
Well, If I Call filter like this: filter: AdminReportsWorksnaps.filterMinutes('totalMinutes', 5000,6000)" it works perfectly fine.. I just cant see how can I pass the input values from the textboxs.
Thanks