diff options
author | Sudarshan Kumar <sudarshan.kumar@att.com> | 2020-01-31 17:10:17 +0530 |
---|---|---|
committer | Sudarshan Kumar <sudarshan.kumar@att.com> | 2020-02-03 07:45:35 +0000 |
commit | 5505e42484efac0273627795583179d58f81a1ee (patch) | |
tree | aaa7a249a6f8c6eec80babbd37ffaa29a0ca3152 /ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared | |
parent | 2edccd7e8ef958d4891ba6de87a449daeb7593fe (diff) |
Added RDP Library
added RDP Library
Issue-ID: PORTAL-826
Change-Id: If00af4c55b568bb4e41c789b6b18749d8bc96858
Signed-off-by: Sudarshan Kumar <sudarshan.kumar@att.com>
Diffstat (limited to 'ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared')
-rw-r--r-- | ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared/services/app.service.spec.ts | 12 | ||||
-rw-r--r-- | ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared/services/app.service.ts | 66 |
2 files changed, 78 insertions, 0 deletions
diff --git a/ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared/services/app.service.spec.ts b/ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared/services/app.service.spec.ts new file mode 100644 index 00000000..9bdcf24c --- /dev/null +++ b/ecomp-sdk/portalsdk-tag-lib-test-app/src/app/shared/services/app.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { AppService } from './app.service'; + +describe('AppService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: AppService = TestBed.get(AppService); + expect(service).toBeTruthy(); + }); +}); 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; + } + +} |