summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared/services/app.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared/services/app.service.ts')
-rw-r--r--ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared/services/app.service.ts66
1 files changed, 66 insertions, 0 deletions
diff --git a/ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared/services/app.service.ts b/ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared/services/app.service.ts
new file mode 100644
index 00000000..0860e113
--- /dev/null
+++ b/ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared/services/app.service.ts
@@ -0,0 +1,66 @@
+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<any[]>{
+ 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;
+ }
+
+}