title: How to use search filter in Angular for nested JSON object?
body: <p>I am bringing data from my mongoose to display on my HTML table. I am able to filter a JSON object normally but unable to filter nested JSON object?</p>
  
  <p>I have used "<code>npm i ng2-search-filter --save</code> " to import filter pipe, but this only works for the first level. Doesn't do filter for the nested JSON object.</p>
  
  <p>My JSON object is:</p>
  
  <pre><code>{
      packageName:test,
      packagePrice:200,
      userid:{
          userName:John,
          userAge: 27
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>     &lt;input type="text" class="form-control" [(ngModel)]="searchtext" 
       placeholder="Search"&gt;
  
        &lt;table class="table table-hover"&gt;
        &lt;thead&gt;
          &lt;tr&gt;
            &lt;th scope="col"&gt;Package Name&lt;/th&gt;
            &lt;th scope="col"&gt;Package Price&lt;/th&gt;
            &lt;th scope="col"&gt;Customer Name&lt;/th&gt;
            &lt;th scope="col"&gt;Customer Age&lt;/th&gt;
          &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody *ngFor="let use of user | filter:searchtext"&gt;
          &lt;tr class="table-active"&gt;
            &lt;td&gt; {{use.packageName}}&lt;/td&gt;
            &lt;td&gt;{{use.packagePrice}}&lt;/td&gt;
            &lt;td&gt;{{use.userid.userName}}&lt;/td&gt;
            &lt;td&gt;{{use.userid.userAge}}&lt;/td&gt;       
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>When I enter packageName and packagPrice in a textbox for search filter it filters out and shows me correct result, but on userName and userAge its not working.
  Please help.
  Thank you.</p>