Created
July 21, 2018 19:39
-
-
Save ozgurrgul/e91f70d7306a21ece03490fdbc057cca 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 {HttpClient} from '@angular/common/http'; | |
import {Observable} from 'rxjs'; | |
import {LoginResultModel} from './model/LoginResultModel' | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class ApiService { | |
constructor(private http: HttpClient) { | |
} | |
login(email: string, password: string): Observable<LoginResultModel>{ | |
return this.http.post<LoginResultModel>('https://reqres.in/api/login', { | |
email: email, | |
password: password | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment