Currently in the service i am calling http.get as follow
getList(): Observable<Customer[]> {
return this.http.get<Customer[]>("api/customers");
}
in component ngOnInit the list of customer is returned:
this.customerService.getList().subscribe(data => (this.customers = data));
It is working fine. Now i want to sorting the list before returning to the component.
any idea of how to return sorted list in the service to compnent?