import { Injectable } from '@angular/core'; import { HttpClient, HttpResponse } from '@angular/common/http'; import { Observable } from 'rxjs/Observable'; import { SERVER_API_URL } from 'app/app.constants'; @Injectable() export class AccountService { constructor(private http: HttpClient) {} get(): Observable> { return this.http.get(SERVER_API_URL + 'api/account', { observe: 'response' }); } save(account: any): Observable> { return this.http.post(SERVER_API_URL + 'api/account', account, { observe: 'response' }); } }