大佬教程收集整理的这篇文章主要介绍了angularjs:$filter在尝试获取过滤数据时未定义,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
任何想法?
还有noch $ filter Object …但是如何创建一个呢? $ filter(‘filter’)显然不工作!
<html ng-app> <head> <Meta charset="UTF-8"> <title>Document</title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script> </head> <body ng-controller="List"> Search: <input ng-change="getData(names,query)" ng-model="query"> Search: <SELEct ng-change="getData(names,query2)" ng-model="query2"> <option></option> <option>Berlin</option> <option>Hamburg</option> </SELEct> <div> <ul class="names" > <li ng-model="item" " ng-repeat="name in names | filter:query | filter:query2"> {{name.firstnamE}},{{name.lastnamE}},{{name.agE}},{{name.LOCATIOn}} </li> </ul> </div> <script type="text/javascript"> function List($scopE) { $scope.names = [ {"firstname": "Carl","lastname": "Luyk","age": 20,"LOCATIOn":"Berlin"},{"firstname": "Carl","lastname": "Moreen","LOCATIOn":"Hamburg"},{"firstname": "Tom","age": 25,"LOCATIOn":"New York"},{"firstname": "Caren","lastname": "Tilt","LOCATIOn":"Paris"},"lastname": "Orail","age": 30,]; $scope.getData = function (names,query) { $scope.queryData = $filter('filter')(names,query); console.log($scope.queryData); }; } </script> </body> </html>
以上是大佬教程为你收集整理的angularjs:$filter在尝试获取过滤数据时未定义全部内容,希望文章能够帮你解决angularjs:$filter在尝试获取过滤数据时未定义所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。