Yogesh N
2015-07-13 07:10:40 UTC
Hi
I am filtering the customer list based on the query typed by the user in
the suggest box.
Here is the code to get filtered customer list.
$scope.getCustomers = function (query) {
customerList = ($filter('partyFilter')(customerList, query));
}
Here is the my custom filter.
angular.module('filterModule', [])
.filter("partyFilter", function() {
return function(partyList, query) {
var filteredList = [];
for (i = 0; i < partyList.length; i++) {
var fullName = partyList[i].fullName;
if (fullName.toLowerCase().includes(query.toLowerCase())) {
filteredList.push(partyList[i]);
}
}
return filteredList;
};
});
The customer list is empty when i execute this code. Can anyone please
suggest what is the issue in this code.
Thanks in advance.
I am filtering the customer list based on the query typed by the user in
the suggest box.
Here is the code to get filtered customer list.
$scope.getCustomers = function (query) {
customerList = ($filter('partyFilter')(customerList, query));
}
Here is the my custom filter.
angular.module('filterModule', [])
.filter("partyFilter", function() {
return function(partyList, query) {
var filteredList = [];
for (i = 0; i < partyList.length; i++) {
var fullName = partyList[i].fullName;
if (fullName.toLowerCase().includes(query.toLowerCase())) {
filteredList.push(partyList[i]);
}
}
return filteredList;
};
});
The customer list is empty when i execute this code. Can anyone please
suggest what is the issue in this code.
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.