FarmMapsLib/projects/common/src/lib/services/user.service.ts

19 lines
569 B
TypeScript
Raw Normal View History

2019-07-15 14:54:19 +00:00
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { IUser } from '../models/user';
import { HttpClient } from "@angular/common/http";
import { AppConfig } from "../shared/app.config";
@Injectable()
export class UserService {
private _apiEndPoint: string;
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
this._apiEndPoint = "";//appConfig.getConfig("apiEndPoint");
}
getCurrentUser(): Observable<IUser> {
return this.httpClient.get<IUser>(`${this._apiEndPoint}/api/v1/currentuser`);
}
}