Q:

filtering a specific data from the fetched data

I want to filter a specific data from a database and return it to the page.
my strategy was use httpClient get method in the service and only get
specific data. how I can handle the filtering
so far I can get all the data included in a testurl but I dont know how to filter the specific ones
data.json
[
    {"allOrders":21},
    {"pendingConfirmOrders":14},
    {"pendingPaymentOrders":8}
]

order-history.component.ts
import { orderHistoryService } from './../../infrastructure/services/order-history.service';
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-order-history-page',
  templateUrl: './order-history-page.component.html',
  styleUrls: ['./order-history-page.component.scss']
})
export class OrderHistoryPageComponent implements OnInit {
orderHistory:any;
confirmOrder;
  constructor(private orderService:orderHistoryService) {
    this.orderService.getOrderHistory().subscribe((response:any)=>{
      this.orderHistory = response;
    });
   }
  _orderHistory(){
    console.log(this.orderHistory);
  }
  _pendingConformation(){
    this.confirmOrder=this.orderHistory.filter(orders=> this.orderHistory
      .includes(this.confirmOrder));
  }

  ngOnInit() {
  }

}

orderService.ts

import { Injectable } from '@angular/core';
import { AppSettings } from '../../app.setting';
import { ApiService } from './api.service';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class orderHistoryService {
    private testUrl='../../../assets/data/orders.json';
//   _baseUrl = AppSettings.BACKEND2_SUBSCRIBE_BASE;
  constructor(private _apiService: ApiService, private _http: HttpClient) { }
  getOrderHistory():Observable<any>{
    return this._http.get<any>(this.testUrl);
    //  const endpoint = `${AppSettings.SERVER_API}`//endpoint;
    //  return this._http.get(endpoint);
  }
  /**
 * THIS METHOD GET The history of orders
 */
}

the functions I wrote returns an empty array

A:

Since data.json is an array of JSON objects, you will need to include the index of the array when you create JavaScript variables to hold the data from your API response.
Creating the variables should look something like this:
allOrders = orderHistory[0].allOrders;
pendingConfirmOrders = orderHistory[1].pendingConfirmOrders;
pendingPaymentOrders = orderHistory[2].pendingPaymentOrders;

This is only going to work if you know the structure of data.json will not change. If you have control over the API, I would recommend getting rid of the array and making the output look something like this:
{
"allOrders":21,
"pendingConfirmOrders":14,
"pendingPaymentOrders":8
}

This way, you would be able to omit the array index and access the data as you mentioned in your comment above - using orderHistory.pendingConfirmOrders;

