大佬教程收集整理的这篇文章主要介绍了过滤数字范围:AngularJS,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
http://plnkr.co/edit/h8p8rtZuAhCoKClUjgE9?p=preview
<table border="1" style="width:200px"> <tr> <td> <div>Name : {{ formElement.name }} </div><br> </td> </tr> <tr> <td> <div>Age : {{ formElement.age }}</div><br> </td> </tr>
$scope.byRange = function (fieldName,minValue,max@R_262_7548@ { if (minValue === undefined) minValue = number.min_value; if (maxValue === undefined) maxValue = number.max_value; return function preDicateFunc(item) { return minValue <= item[fieldName] && item[fieldName] <= maxValue; }; };
并在Ng-repeat表达中使用它:
<div ng-repeat="formElement in formElements | filter:byRange('age',filterModelMin.age,filterModelMax.agE)">
请注意,filterModelMin.age和filterModelMax.age可以直接在fasterDisplay指令中使用,因为fasterForm和fasterDisplay都没有自己的作用域.
示例plunker:http://plnkr.co/edit/dFbBCKxSxm9RI9dwSeYR?p=preview
以上是大佬教程为你收集整理的过滤数字范围:AngularJS全部内容,希望文章能够帮你解决过滤数字范围:AngularJS所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。