{"action":"closed","issue":{"url":"https://api.github.com/repos/angular/angular-hint-dom/issues/22","labels_url":"https://api.github.com/repos/angular/angular-hint-dom/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular-hint-dom/issues/22/comments","events_url":"https://api.github.com/repos/angular/angular-hint-dom/issues/22/events","html_url":"https://github.com/angular/angular-hint-dom/issues/22","id":53479755,"number":22,"title":"TypeError: haystack.toLowerCase is not a function","user":{"login":"nilamsavani","id":10339821,"avatar_url":"https://avatars.githubusercontent.com/u/10339821?v=3","gravatar_id":"","url":"https://api.github.com/users/nilamsavani","html_url":"https://github.com/nilamsavani","followers_url":"https://api.github.com/users/nilamsavani/followers","following_url":"https://api.github.com/users/nilamsavani/following{/other_user}","gists_url":"https://api.github.com/users/nilamsavani/gists{/gist_id}","starred_url":"https://api.github.com/users/nilamsavani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilamsavani/subscriptions","organizations_url":"https://api.github.com/users/nilamsavani/orgs","repos_url":"https://api.github.com/users/nilamsavani/repos","events_url":"https://api.github.com/users/nilamsavani/events{/privacy}","received_events_url":"https://api.github.com/users/nilamsavani/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-06T04:24:56Z","updated_at":"2015-01-06T10:03:03Z","closed_at":"2015-01-06T10:03:03Z","body":"Hello\r\nI am trying to do searching using angular js and here is my code...i am getting an error haystack.toLowerCase is not a function.....\r\n\r\n$scope.sortingOrder = sortingOrder;\r\n            $scope.reverse = false;\r\n            $scope.filteredItems = [];\r\n            $scope.groupedItems = [];\r\n            $scope.itemsPerPage = 5;\r\n            $scope.pagedItems = [];\r\n            $scope.currentPage = 0;\r\n            $http.post(\"InsertDataDemo.aspx/BindGrid\", {})\r\n                   .success(function (response) {\r\n                       var item = response.d.Table;\r\n                       $scope.items = item;\r\n\r\nvar searchMatch = function (haystack, needle) {\r\n                       \r\n                           if (!needle) {\r\n                               \r\n                               return true;\r\n                           }\r\n                      \r\n                           return haystack.toLowerCase().indexOf(needle.toLowerCase()) !== -1;\r\n                          \r\n                       };\r\n\r\n                       // init the filtered items\r\n                       $scope.search = function () {\r\n                           $scope.filteredItems = $filter('filter')($scope.items, function (item) {\r\n                               // alert(item);\r\n                               for (var attr in item) {\r\n                                   if (searchMatch(item[attr], $scope.query))\r\n                                       return true;\r\n                               }\r\n                               return false;\r\n                           });\r\n                           // take care of the sorting order\r\n                           if ($scope.sortingOrder !== '') {\r\n                               $scope.filteredItems = $filter('orderBy')($scope.filteredItems, $scope.sortingOrder, $scope.reverse);\r\n                           }\r\n                           $scope.currentPage = 0;\r\n                           // now group by pages\r\n                           $scope.groupToPages();\r\n                       };\r\n});\r\n\r\n<script src=\"http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js\"></script>\r\n     <script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\" type=\"text/javascript\"></script>"}}