Advertisement
Guest User

Untitled

a guest
Aug 7th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. <ion-item>
  2. <ion-label floating>Name</ion-label>
  3. <ion-input type="text" id="name"></ion-input>
  4. </ion-item>
  5.  
  6. <ion-item>
  7. <ion-label floating>Email</ion-label>
  8. <ion-input type="email" id="email"></ion-input>
  9. </ion-item>
  10.  
  11. <ion-item>
  12. <ion-label floating>Password</ion-label>
  13. <ion-input type="password" id="password"></ion-input>
  14. </ion-item>
  15.  
  16. <ion-item>
  17. <ion-label floating>Phone Number</ion-label>
  18. <ion-input type="text" id="phone"></ion-input>
  19. </ion-item>
  20.  
  21. <ion-item>
  22. <ion-label floating>Profile Picture</ion-label>
  23. <ion-input type="file" id="pic"></ion-input>
  24. </ion-item>
  25.  
  26. <button ion-button (click)='userreg();'>Register</button></ion-content>
  27.  
  28. export class Register {
  29.  
  30. @ViewChild('name') name;
  31. @ViewChild('email') email;
  32. @ViewChild('password') password;
  33. @ViewChild('phone') phone;
  34. @ViewChild('pic') pic;
  35.  
  36. constructor(public navCtrl: NavController, private alertCtrl: AlertController) {
  37. }
  38.  
  39. ionViewDidLoad() {
  40. console.log('ionViewDidLoad Register');
  41. }
  42.  
  43. userreg() {
  44. var picURL;
  45. var user = new Backendless.User();
  46. user.email=this.email;
  47. user.password=this.password;
  48. user.name=this.name;
  49. user.phone=this.phone;
  50.  
  51. Backendless.UserService.register( user ).then( this.userRegistered ).catch( this.gotError );
  52. }
  53.  
  54. gotError( err ) // see more on error handling
  55. {
  56. console.log( "error message - " + err.message );
  57. console.log( "error code - " + err.statusCode );
  58. }
  59.  
  60. userRegistered( user )
  61. {
  62. console.log("User registered");
  63. }
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement