JSFiddle - React, Tailwind, and code Playground

by Jesse Florig

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="search.age" placeholder="Age"></input>
        <ul>
            <li ng-repeat="item in items | filter:search">
                {{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) {
  $scope.items = [
    {'name':'Carl', 'age':69},
    {'name':'Neil', 'age':54},
    {'name':'Richard'},
    {'name':'Chris', 'age':58}
  ];
}