Last active
March 5, 2018 10:44
-
-
Save SaurabhLpRocks/e828e6e5a9e8831402acbcb2b8c0c376 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable } from '@angular/core'; | |
| import { Response } from '@angular/http'; | |
| import { Observable } from 'rxjs/Rx'; | |
| import { appApiResources } from '../../app.constants'; | |
| import { LoginResponse } from '../../theme/interfaces/login-response.interface'; | |
| import { HelperService } from '../../theme/services'; | |
| import { BaseService } from '../../theme/services/base.service'; | |
| @Injectable() | |
| export class LoginService { | |
| constructor(public http: BaseService, public helperService: HelperService) { | |
| } | |
| login(postBody: any): Observable<LoginResponse> { | |
| // "appApiResources.login" is the constant string containing login api url | |
| return this.http.post(appApiResources.login, body) | |
| .map((res: LoginResponse) => { | |
| this.processLoginResponse(res); | |
| return res; | |
| }) | |
| .catch((error: Response) => Observable.throw(error)) | |
| .finally(() => { | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment