How to use angular filter on multiple properties of the object
<p>I have a simple ng-repeat like that:</p>

<pre><code>&lt;input type="text" ng-model="vm.filter"&gt;

&lt;div ng-repeat="tenant in vm.tenants | filter : vm.filter : vm.contains"&gt;
 &lt;/div&gt;
</code></pre>

<p>Now I want to filter tenants based on the value of the filter, e.g. to find if a name of a tenant contains the filter expression like that</p>

<pre><code>function contains(actual, expected) {
            return actual.name.indexOf(expected) &gt;= 0;
        }
</code></pre>

<p>What I do not understand is why I get a <code>tenant.name</code> in the contains function instead of the <code>tenant</code> itself. I know for a simple case I can do something like <code>filter | {name: vm.filter} | vm.contains</code>, but what if I want to do filtering based on multiple properties (e.g. name, phone, etc.)</p>