title: Typescript filter adult and child
body: <p>The filter is not working properly. I want to filter the adults with their child numbers and include them in the records. How can I fix the code?</p>
  
  <p>.html</p>
  
  <pre><code>&lt;input id="adult" type="number" [(ngModel)]="adult" (ngModelChange)="changeNumberOfAdults()" /&gt;
  &lt;input id="child" type="number" max="3" min="0" [(ngModel)]="childCount" [(ngModel)]="chd" (ngModelChange)="changeNumberOfChilds()" /&gt;
  </code></pre>
  
  <p>.ts</p>
  
  <pre><code>changeNumberOfAdults() {
      const filtered = this.hotels.filter(x =&gt; x.numberOfAd == this.adult);
      this.dsHotels.data = filtered;
  }
  
  changeNumberOfChilds() {
      const filtered = this.hotels.filter(x =&gt; x.numberOfChd == this.chd);
      this.dsHotels.data = filtered; }
  </code></pre>