title: Angular filter objects array for multiple values
body: <p>I have the following method that filters an object (that has an array of other objects) for an input field: </p>
  
  <pre><code>  filterArray(): void {
      this.json.items.filter((e) =&gt; e.assignedPool != null || e.assignedPool !== undefined);
      this.json.items = this.json.items.filter((e) =&gt; e.name.includes(this.filter));
    }
  </code></pre>
  
  <p>Now I want to filter for another variable. Here is the objecs hierarchie: </p>
  
  <p>the filtered json variable:</p>
  
  <pre><code>export class VirtualServerResponse {
    private _kind: String;
    private _items: VirtualServer[];  
  </code></pre>
  
  <p>a VirtualServer: </p>
  
  <pre><code>  //...properties
    private _assignedPool: PoolDTO;
  </code></pre>
  
  <p>a Pool: </p>
  
  <pre><code>  //properties
    private _membersReference: MembersReferenceDTO;
  </code></pre>
  
  <p>the membersReference: </p>
  
  <pre><code>export class MembersReferenceDTO {
    constructor() {}
    private _link: String;
    private _isSubcollection: String;
    private _items: PoolMemberDTO[];
  </code></pre>
  
  <p>and a single PoolMember: </p>
  
  <pre><code>export class PoolMemberDTO {
    constructor() {}
    private _address: String;
  </code></pre>
  
  <p>Now I want to be able to filter also for the address of a PoolMember, so when the <code>filter</code> matches an address of any PoolMember, something like </p>
  
  <pre><code>this.json.items.foreach((item) =&gt; 
  item.assignedPool.membersReference.items.foreach(member) =&gt;  
  member.address == this.filter)
  </code></pre>
  
  <p>I want to filter the <code>json.items</code> array, so this array contains:</p>
  
  <ul>
  <li>all servers with name matching the filter</li>
  <li>all servers which assignedPool members addresses match the filter</li>
  </ul>
  
  <p>Can someone help me here?</p>
  
  <p>Update:  </p>
  
  <pre><code>Server name: test server
  Assigned pool -&gt; membersReference -&gt;items[]
  items[0]: 10.10.10.2
  items[1]: 10.10.10.3
  </code></pre>
  
  <p>...
  So if the filter is 10.10.10.3, the server 'test server' should be in <code>json.items</code></p>