From b761252bca8a91776c8a4bff3141d527d6deeda7 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Fri, 4 Jan 2019 22:43:22 +0530 Subject: Core module Module holds the singleton services Issue-ID: CCSDK-816 Change-Id: I4303574f97c8598f54479de4b3cbb79eac6f0548 Signed-off-by: Arundathi Patil --- cds-ui/client/src/app/common/core/core.module.ts | 38 ++++++++++++++++ .../src/app/common/core/services/api.service.ts | 52 ++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 cds-ui/client/src/app/common/core/core.module.ts create mode 100644 cds-ui/client/src/app/common/core/services/api.service.ts (limited to 'cds-ui/client/src/app/common') diff --git a/cds-ui/client/src/app/common/core/core.module.ts b/cds-ui/client/src/app/common/core/core.module.ts new file mode 100644 index 000000000..9b812a0b3 --- /dev/null +++ b/cds-ui/client/src/app/common/core/core.module.ts @@ -0,0 +1,38 @@ +/* +============LICENSE_START========================================== +=================================================================== +Copyright (C) 2018 IBM Intellectual Property. All rights reserved. +=================================================================== + +Unless otherwise specified, all software contained herein is licensed +under the Apache License, Version 2.0 (the License); +you may not use this software except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +============LICENSE_END============================================ +*/ + +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { HttpClientModule } from '@angular/common/http'; + +import { ApiService } from './services/api.service'; +// import { BlueprintService } from './services/blueprint.service'; + +@NgModule({ + declarations: [ + ], + imports: [ + CommonModule, + HttpClientModule + ], + providers : [ ApiService ] +}) +export class CoreModule { } diff --git a/cds-ui/client/src/app/common/core/services/api.service.ts b/cds-ui/client/src/app/common/core/services/api.service.ts new file mode 100644 index 000000000..0ee3c6a78 --- /dev/null +++ b/cds-ui/client/src/app/common/core/services/api.service.ts @@ -0,0 +1,52 @@ +/* +============LICENSE_START========================================== +=================================================================== +Copyright (C) 2018 IBM Intellectual Property. All rights reserved. +=================================================================== + +Unless otherwise specified, all software contained herein is licensed +under the Apache License, Version 2.0 (the License); +you may not use this software except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +============LICENSE_END============================================ +*/ + + +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +//import { IBlueprintHttp } from '../store/models/blueprint-http.model'; + +@Injectable() +export class ApiService { + // blueprintUrl = '../../constants/blueprint.json'; + + constructor(private _http: HttpClient) { + } + + get(url: string, params?: any): Observable { + return this._http.get(url); + } + + post() { + // to do + } + + put() { + // to do + } + + delete() { + // to do + } + +} \ No newline at end of file -- cgit 1.2.3-korg