Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     register(email: string, username: string, password: string, image: string, type: number): Promise<any> {
  2.         return new Promise(resolve => {
  3.             if (type === 1) {
  4.                 console.log(email, username, password, image, type)
  5.                 this.http.post(this.userRegisterUrl, { email: email, username: username, password: password, image: image, type: type })
  6.                     .toPromise()
  7.                     .then(response => {
  8.                         resolve(response);
  9.                     })
  10.                     .catch(this.handleError);
  11.             } else if (type === 2 || type === 3) {
  12.                 console.log(email, username, password, image, type)
  13.                 this.http.post(this.userRegisterUrl, { email: email, username: username, token: password, image: image, type: type })
  14.                     .toPromise()
  15.                     .then(response => {
  16.                         resolve(response);
  17.                     })
  18.                     .catch(this.handleError);
  19.             }
  20.         });
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement