Created
January 19, 2018 20:50
-
-
Save dasmido/a80da32a43b30cb069724c61720db876 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 {Http, Headers} from '@angular/http'; | |
import 'rxjs/add/operator/map'; | |
@Injectable() | |
export class AuthService { | |
authToken: any; | |
user: any; | |
constructor(private http: Http) { } | |
// function to register user | |
registerUser(user){ | |
let headers = new Headers(); | |
headers.append('Content-Type', 'application/json'); | |
return this.http.post('http://localhost:9090/users/register', user, {headers: headers}).map(res => res.json()); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment