daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. this.token = data.token;
  2. this.storage.set('token', data.token);
  3.    
  4. createAccount(details){
  5.  
  6.     return new Promise((resolve, reject) => {
  7.  
  8.         let headers = new Headers();
  9.         headers.append('Content-Type', 'application/json');
  10.  
  11.         this.http.post('https://YOUR_HEROKU_APP.herokuapp.com/api/auth/register', JSON.stringify(details), {headers: headers})
  12.           .subscribe(res => {
  13.  
  14.             let data = res.json();
  15.             this.token = data.token;
  16.             this.storage.set('token', data.token);
  17.             resolve(data);
  18.  
  19.           }, (err) => {
  20.             reject(err);
  21.           });
  22.  
  23.     });
  24.  
  25.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top