Skip to content

Instantly share code, notes, and snippets.

@ozgurrgul
Created July 21, 2018 19:39
Show Gist options
  • Save ozgurrgul/e91f70d7306a21ece03490fdbc057cca to your computer and use it in GitHub Desktop.
Save ozgurrgul/e91f70d7306a21ece03490fdbc057cca to your computer and use it in GitHub Desktop.
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