| adduser(user) { | |
| var creds = "name=" + user.name + "&password=" + user.password; | |
| var headers = new Headers(); | |
| headers.append('Content-Type', 'application/x-www-form-urlencoded'); | |
| return new Promise(resolve => { | |
| this.http.post('http://api.local.dev:3000/v1/', creds, {headers: headers}).subscribe(data => { | |
| if (data.json().success) { | |
| resolve(true); | |
| } | |
| else | |
| resolve(false); | |
| }); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment