Search code examples
angularjsprototypeangular-filters

Getting error on Angular Filter - Function.prototype.toString is not generic


I have objects of function A which has prototype functions.

I am trying to use filterFilter in ctrl file. And I am getting below error

TypeError: Function.prototype.toString is not generic
at Franchise.toString (<anonymous>)
at comparator (../bower_components/angular/angular.js:18856:29)
at deepCompare (../bower_components/angular/angular.js:18911:16)
at deepCompare (../bower_components/angular/angular.js:18895:47)
at deepCompare (../bower_components/angular/angular.js:18891:42)
at predicateFn (../bower_components/angular/angular.js:18866:12)
at Array.filter (native)
at ../bower_components/angular/angular.js:18830:35

My filter code -

searchQuery = {'taluka': 'someval'};
lookupList = [{
                   deliveryDetails: {taluka: 'someval'}
             }];
return filterFilter(lookupList, searchQuery);

Solution

  • My Bad.. I had unknowingly overwritten prototype of Franchise prototype to something else. I corrected it and it worked...