JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app>
<p>As soon as you filter the age "Richard" is removed from the list since age is null on that object. I want to figure out a way to re-include the nulls when the age filter textbox is empty.</p>
<div ng-controller="ListCtrl">
<input type="text" ng-model="searchObj.age" placeholder="Age"></input>
<ul>
<li ng-repeat="item in items | filter: searchObj.age">
{{item.name}} - {{item.age}}
</li>
</ul>
</div>
<p>I tried popping the age property off the search object, but couldnt get it to work.</p>
</div>
JavaScript
function ListCtrl($scope) {
// both options for filter in above html seem to work :
// ng-repeat="item in items | filter: searchObj.age"
// ng-repeat="item in items | filter: {age: searchObj.age || undefined}"
$scope.searchObj = {
}
$scope.items = [
{'name':'Carl', 'age':69},
{'name':'Neil', 'age':55},
{'name':'Richard'},
{'name':'Chris', 'age':58}
];
}