Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ion-item>
- <ion-label floating>Name</ion-label>
- <ion-input type="text" id="name"></ion-input>
- </ion-item>
- <ion-item>
- <ion-label floating>Email</ion-label>
- <ion-input type="email" id="email"></ion-input>
- </ion-item>
- <ion-item>
- <ion-label floating>Password</ion-label>
- <ion-input type="password" id="password"></ion-input>
- </ion-item>
- <ion-item>
- <ion-label floating>Phone Number</ion-label>
- <ion-input type="text" id="phone"></ion-input>
- </ion-item>
- <ion-item>
- <ion-label floating>Profile Picture</ion-label>
- <ion-input type="file" id="pic"></ion-input>
- </ion-item>
- <button ion-button (click)='userreg();'>Register</button></ion-content>
- export class Register {
- @ViewChild('name') name;
- @ViewChild('email') email;
- @ViewChild('password') password;
- @ViewChild('phone') phone;
- @ViewChild('pic') pic;
- constructor(public navCtrl: NavController, private alertCtrl: AlertController) {
- }
- ionViewDidLoad() {
- console.log('ionViewDidLoad Register');
- }
- userreg() {
- var picURL;
- var user = new Backendless.User();
- user.email=this.email;
- user.password=this.password;
- user.name=this.name;
- user.phone=this.phone;
- Backendless.UserService.register( user ).then( this.userRegistered ).catch( this.gotError );
- }
- gotError( err ) // see more on error handling
- {
- console.log( "error message - " + err.message );
- console.log( "error code - " + err.statusCode );
- }
- userRegistered( user )
- {
- console.log("User registered");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement