AngularJS ng-repeat filter based on select option
You'll need to change your select to:
<select name="show-filter" ng-model="searchText" ...
instead of
<select name="show-filter" ng-model="searchText.accruedcard" ...
Explanation: From what I've seen, it's not common to use a hard-coded option along with ng-options and this is contributing to the problem. The filter uses the select's model, which currently is an object instead of a string as in the Angular example. Object patterns are okay but in this case the object's properties become null
when All is selected because it is not wired into the select the same way as the rest of the options.
This is what causes the searchText
filter to fail because it expects valid strings (even when using an object for the matching pattern).
By using a string primitive for the select's model, the All 'hack' is preserved because it causes the select's model to become (''
) instead of null, which will match everything and all the results are shown.