(user: User)
| 14 | constructor(private http: Http) { } |
| 15 | |
| 16 | register(user: User) { |
| 17 | let headers = new Headers(); |
| 18 | headers.append("Content-Type", "application/json"); |
| 19 | |
| 20 | return this.http.post( |
| 21 | BackendService.apiUrl + "Users", |
| 22 | JSON.stringify({ |
| 23 | Username: user.email, |
| 24 | Email: user.email, |
| 25 | Password: user.password |
| 26 | }), |
| 27 | { headers: headers } |
| 28 | ) |
| 29 | .catch(this.handleErrors); |
| 30 | } |
| 31 | |
| 32 | login(user: User) { |
| 33 | let headers = new Headers(); |