import { Injectable } from '@angular/core'; import { RdpCrudInterface } from 'portalsdk-tag-lib'; import { HttpClient, HttpParams } from '@angular/common/http'; import { map } from "rxjs/operators"; import { Observable } from 'rxjs'; @Injectable({ providedIn: 'root' }) export class AppService implements RdpCrudInterface{ constructor(private http:HttpClient) { } add(data:any){ console.log("Add method is getting called from AppServie data:: ",data); } update(data:any){ console.log("Update method is getting called from AppServie data:: ",data); } delete(data:any){ console.log("Delete method is getting called from AppServie data::>> ",data); } get(data: any) { console.log("get method is getting called from AppServie data:: ",data); } loadTableData(filter: any, sortActive: any, sortDirection: any, pageIndex: any, pageSize: any): Observable{ let users = []; if(pageIndex == 0){ users = [ {"id": "1", "name": "Sundar","company": "AT&T","location": "USA"}, {"id": "2", "name": "Kishore", "company": "AT&T","location": "USA"}, {"id": "3", "name": "Sudarshan","company": "AT&T","location": "India"}, {"id": "4", "name": "Jegadeesh","company": "AT&T","location": "India"}, {"id": "5", "name": "Muni","company": "AT&T","location": "USA"} ]; } if(pageIndex == 1){ users = [ {"id": "6", "name": "Abhay","company": "AT&T","location": "USA"}, {"id": "7", "name": "Tom", "company": "AT&T","location": "USA"}, {"id": "8", "name": "Rachitha","company": "AT&T","location": "India"}, {"id": "9", "name": "Shankar","company": "AT&T","location": "India"}, {"id": "10", "name": "Balaji","company": "AT&T","location": "USA"} ]; } console.log("applicationService loadTableData called ::"); console.log("applicationService loadTableData filter ::",filter); console.log("applicationService loadTableData sort-Active ::",sortActive); console.log("applicationService loadTableData sortDirection ::",sortDirection); console.log("applicationService loadTableData pageIndex ::",pageIndex); console.log("applicationService loadTableData pageSize ::",pageSize); return Observable.create( observer => { observer.next(users); observer.complete(); }); } getTotalRowCount(): any { //write logic to get total row Counts of Table return 10; } }