Skip to content

Instantly share code, notes, and snippets.

@NrI3
Last active October 8, 2019 04:08
Show Gist options
  • Save NrI3/71bbef443795addac04106a724767173 to your computer and use it in GitHub Desktop.
Save NrI3/71bbef443795addac04106a724767173 to your computer and use it in GitHub Desktop.
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