title: Filtering users in Angular 6 without creating a custom pipe
body: <p>I would like to take the following user.component template and make it so that the string entered in the text input field filters the items in the users array.  In other words, I only want those users in the array matching the string inputted to be displayed.  How do I bind the input value to the view without creating a custom pipe?  Since I am using Angular 6, I cannot use the 'filter' pipe anymore.</p>
  
  <p>If I use an [(ngModel)] two-way binding directive, how do I filter the string passed into it inside my component without creating a custom pipe?</p>
  
  <p>Here is the users.component.html template:</p>
  
  <pre><code>&lt;div class="wrapper"&gt;
    &lt;span id = "search-box"&gt;&lt;input class = "col-lg-7" id= "search-input" type="text"  name="users" placeholder = "Search by name"&gt;&lt;/span&gt;
    &lt;span id= "people"&gt;{{users.length}} &lt;span *ngIf = "users.length == 1"&gt;Person&lt;/span&gt;&lt;span *ngIf = "users.length &gt; 1"&gt;People&lt;/span&gt;&lt;/span&gt;
    &lt;div class="accordion" id="accordionExample"&gt;
    &lt;div class="card" *ngFor = "let user of users"&gt;
      &lt;div class="card-header" id="headingOne"&gt;
        &lt;h5 class="mb-0"&gt;
          &lt;button class="btn btn-link" type="button" data-toggle="collapse" [attr.data-target]="'#' + user" aria-expanded="true" aria-controls="collapseOne"&gt;
            {{user}}
          &lt;/button&gt;
        &lt;/h5&gt;
      &lt;/div&gt;
        &lt;div [attr.id]= "user" class="collapse" aria-labelledby="headingOne" data-parent="#accordionExample"&gt;
         &lt;div class="card-body"&gt;
          &lt;img src="./assets/user.jpg" id= "user-pic"&gt;
          Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;&lt;!-- end of .card --&gt;
   &lt;/div&gt;&lt;!--end of .accordion--&gt;
  &lt;/div&gt;&lt;!--end of .wrapper --&gt;
  </code></pre>
  
  <p>And here is the users.component.ts file:</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  
  @Component({
    selector: 'app-users',
    templateUrl: './users.component.html',
    styleUrls: ['./users.component.css']
  })
  export class UsersComponent implements OnInit { 
  
   users: any[] = [
      "Bob",
      "James",
      "Mary"
    ];
  
    constructor() { }
  
    ngOnInit() {
    }
  }
  </code></pre>
  
  <p>If I need to use a custom pipe, please tell me how to set this up?</p>