import { Component , OnInit } from '@angular/core' ; import { FormBuilder , FormGroup , Validators } from '@angular/forms' ; import { NavController , MenuController , LoadingController } from '@ionic/angular' ; @ Component ( { selector : 'app-register' , templateUrl : './register.page.html' , styleUrls : [ './register.page.scss' ] , } ) export class RegisterPage implements OnInit { public onRegisterForm : FormGroup ; constructor ( public navCtrl , public menuCtrl , public loadingCtrl , private formBuilder ) { } ionViewWillEnter ( ) { this . menuCtrl . enable ( false ) ; } ngOnInit ( ) { this . onRegisterForm = this . formBuilder . group ( { 'fullName' : [ null , Validators . compose ( [ Validators . required ] ) ] , 'email' : [ null , Validators . compose ( [ Validators . required ] ) ] , 'password' : [ null , Validators . compose ( [ Validators . required ] ) ] } ) ; } async signUp ( ) { const loader = await this . loadingCtrl . create ( { duration : 2000 } ) ; loader . present ( ) ; loader . onWillDismiss ( ) . then ( ( ) => { this . navCtrl . navigateRoot ( '/home-results' ) ; } ) ; } goToLogin ( ) { this . navCtrl . navigateRoot ( '/' ) ; } }