Last active
October 8, 2019 04:08
-
-
Save NrI3/71bbef443795addac04106a724767173 to your computer and use it in GitHub Desktop.
This file contains 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 { HttpHeaders } from '@angular/common/http'; | |
import { Autenticar } from './Autenticar' | |
import { Observable } from 'rxjs'; | |
export interface Config { | |
heroesUrl: string; | |
textfile: string; | |
} | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class ConfigService { | |
configUrl = 'assets/config.json'; | |
url = 'http://localhost:3000/autenticar' | |
constructor(private http:HttpClient) {} | |
autenticate (autenticar: Autenticar): Observable<Autenticar> { | |
let headers = new HttpHeaders() | |
.set('Content-Type', 'application/json') | |
console.log(headers) | |
return this.http.post<Autenticar>(this.url, autenticar,{headers}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment