diff --git a/src/app/app.module.ts b/src/app/app.module.ts index cbd6b0c..5429895 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,6 +3,8 @@ import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { HttpClientModule } from '@angular/common/http'; + import { AppRoutingModule } from './app-routing.module'; import { AppReducerModule } from './app-reducer.module'; import { MaterialModule } from './commons/ui/material/material.module'; @@ -21,6 +23,7 @@ import { AppComponent } from './app.component'; AppReducerModule, MaterialModule, CovalentModule, + HttpClientModule, ], bootstrap: [AppComponent] }) diff --git a/src/app/commons/service/rest.service.ts b/src/app/commons/service/rest.service.ts index a881615..5812058 100644 --- a/src/app/commons/service/rest.service.ts +++ b/src/app/commons/service/rest.service.ts @@ -1,8 +1,34 @@ -import { Injectable } from '@angular/core'; +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs/Observable'; + +import 'rxjs/add/operator/do'; @Injectable() export class RESTService { + private baseURL: string; - constructor() { } + constructor( + @Inject(HttpClient) private httpClient: HttpClient, + ) { + + } + + public get(entry: string, ...args: any[]): Observable { + const headers: HttpHeaders = new HttpHeaders(); + headers + .set('Accept', 'application/json') + .set('Content-Type', 'application/json'); + + this.httpClient + .get('') + .do( + (data: any) => { + + } + ); + return undefined; + } } diff --git a/src/app/packages/member/service/member.service.ts b/src/app/packages/member/service/member.service.ts index 3e4c24e..24abbb2 100644 --- a/src/app/packages/member/service/member.service.ts +++ b/src/app/packages/member/service/member.service.ts @@ -8,7 +8,9 @@ export class MemberService { public constructor( private rpcService: RPCService, - ) { } + ) { + + } public signin(email: string, password: string) { this.rpcService.call('MemberService.signin', email, password).subscribe(