Created
February 10, 2020 12:07
-
-
Save abhishekluv/8f6d1beaaa25206a6dbc86e7739f0c9d to your computer and use it in GitHub Desktop.
Angular Source Code Demo 1
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, HttpHeaders } from '@angular/common/http'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class AccountService { | |
constructor(private http: HttpClient) { } | |
RegisterUser(user) { | |
let getHeaders: HttpHeaders = new HttpHeaders({ 'Content-Type': 'application/json' }); | |
return this.http.post("https://localhost:44391/register", user, { headers: getHeaders }); | |
} | |
LoginUser(user) { | |
let getHeaders: HttpHeaders = new HttpHeaders({ 'Content-Type': 'application/json' }); | |
return this.http.post("https://localhost:44391/token", user, { headers: getHeaders }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment