title: How to filter data in the controller in angular 4
body: <p>I have the following function</p>
  
  <pre><code>getMyList(id:number){
    this.subCatSvs.getList(id)
      .subscribe(List =&gt; {
         this.List = List;
       });
  };
  </code></pre>
  
  <p>The output of this function is:</p>
  
  <pre><code>[
  {
  "id": 678,
  "name": "Bench",
  "type": "furniture",
  },
  {
  "id": 679,
  "name": "Chair",
  "type": "furniture",
  
  },
  {
  "id": 677,
  "name": "Stool",
  "type": "furniture",
  
  },
  {
  "id": 679,
  "name": "Chair",
  "type": "furniture",
  
  },
  {
  "id": 680,
  "name": "Car",
  "type": "Vehicle",
  
  },
  {
  "id": 681,
  "name": "Van",
  "type": "Vehicle",
  
  },
  ]
  </code></pre>
  
  <p>How can I modify my function to be able to filter date by "type"? For example, I just want my output to show vehicle. Thanks for your help.</p>
  
  <p>AJ</p>