title: How to make function return reports based on report categoryID Paramter on service.ts?
body: <p>I work on angular 7 app I need to return data from allReportsubCategory based on report Category ID </p>
  
  <p>but I face issue how to return data from allReportsubCategory based on reportcategoryID .</p>
  
  <p>so How to write function return reports based on ReportCategoryID ?</p>
  
  <pre><code>allReportsubCategory:any[];
  this.allReportsubCategory =[
      {
          "reportID": 1,
          "reportName": "xxx",
          "reportIndex": 1,
          "reportCategoryID": 3,
  
      },
      {
          "reportID": 17,
          "reportName": "Jobs Monitor",
          "reportIndex": 1,
          "reportCategoryID": 3
      },
      {
          "reportID": 2025,
          "reportName": "Old Tables Report",
          "reportIndex": 1,
          "reportCategoryID": 3
  
      }];
  </code></pre>
  
  <p>on service.ts</p>
  
  <pre><code> GetreportByCategoryId(reportCategoryID:string){
      return this.allReportsubCategory.??????
  
    }
  </code></pre>
  
  <p>so I need when pass 3 to function GetreportByCategoryId(reportcategoryID) return all data above based on 
  reportcategoryid= 3</p>
  
  <p><strong>updated post</strong> </p>
  
  <p>when call it on component as below </p>
  
  <pre><code>reportByCategoryId:any[]
   this.reportByCategoryId = this._displayreport.GetreportByCategoryId("3");
    console.log("data by category id" + this.reportByCategoryId )
  </code></pre>
  
  <p>no return for data above and console log as below :</p>
  
  <p>data by category idundefined</p>