From d79623817d992cb63c572f5a561b9f0684d33da9 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 30 Jul 2023 17:30:48 -0400 Subject: [PATCH] zRegister --- .../pages/notification/notification.page.html | 10 +-- src/app/pages/profile/profile.page.html | 2 +- src/app/pages/register/register.page.html | 8 +-- src/app/pages/register/register.page.ts | 72 +++++++++++++++---- 4 files changed, 64 insertions(+), 28 deletions(-) diff --git a/src/app/pages/notification/notification.page.html b/src/app/pages/notification/notification.page.html index e0f99e6..9c2ee80 100644 --- a/src/app/pages/notification/notification.page.html +++ b/src/app/pages/notification/notification.page.html @@ -1,11 +1,3 @@ - @@ -18,7 +10,7 @@ - Notification + Notifications diff --git a/src/app/pages/profile/profile.page.html b/src/app/pages/profile/profile.page.html index a677dea..4f8dd24 100644 --- a/src/app/pages/profile/profile.page.html +++ b/src/app/pages/profile/profile.page.html @@ -31,7 +31,7 @@ - Notification + Notifications diff --git a/src/app/pages/register/register.page.html b/src/app/pages/register/register.page.html index 27d3d5a..92d6f33 100644 --- a/src/app/pages/register/register.page.html +++ b/src/app/pages/register/register.page.html @@ -11,24 +11,24 @@ - + - + - + - + diff --git a/src/app/pages/register/register.page.ts b/src/app/pages/register/register.page.ts index d166d1d..b081ee5 100644 --- a/src/app/pages/register/register.page.ts +++ b/src/app/pages/register/register.page.ts @@ -1,13 +1,6 @@ -/* - Authors : initappz (Rahul Jograna) - Website : https://initappz.com/ - App Name : E-Learning App Template - This App Template Source code is licensed as per the - terms found in the Website https://initappz.com/license - Copyright and Good Faith Purchasers © 2021-present initappz. -*/ import { Router } from '@angular/router'; -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit, ViewChild} from '@angular/core'; +import {ToastController} from "@ionic/angular"; @Component({ selector: 'app-register', @@ -15,10 +8,29 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./register.page.scss'], }) export class RegisterPage implements OnInit { - + @ViewChild('username') username; + @ViewChild('password') password; + @ViewChild('firstname') firstname; + @ViewChild('lastname') lastname; + @ViewChild('country') country; + /* + 'firstname': 'OluNG' , + 'lastname': 'AmeyNG' , + 'email': 'ameye+aug6160@chiefsoft.com' , + 'username': 'ameye+aug6160@chiefsoft.com' , + 'password': 'may12002' , + 'terms' => 1, + 'news' => int 1 + 'loc': '38.101.241.200' , + 'country': 'NG' , + 'action' => 11010 + */ constructor( - private router: Router - ) { } + private router: Router, + private toastController: ToastController + ) { + + } ngOnInit() { } @@ -28,7 +40,39 @@ export class RegisterPage implements OnInit { } onFillProfile() { - this.router.navigate(['fill-profile']); - } + //debugger; + + if (this.username == null || this.username == '' || this.validateEmail(this.username) == false + || this.password == null || this.password == '' + || this.firstname == null || this.firstname == '' + || this.lastname == null || this.lastname == '') { + this.presentToast('Missing Required Inputs', 'middle'); + return; + } + //this.router.navigate(['fill-profile']); + alert("WE CALL API NOW"); + } + showAlert(mtitle: string, amessage: string) { + /* let alert = this.alertCtrl.create({ + title: mtitle, + subTitle: amessage, + buttons: ['OK'] + }); + alert.present();*/ + alert(amessage); + } + validateEmail(email) { + var re = /\S+@\S+\.\S+/; + return re.test(email); + } + async presentToast(amessage, position: 'top' | 'middle' | 'bottom') { + const toast = await this.toastController.create({ + message: amessage, + duration: 1500, + position: position, + }); + + await toast.present(); + } }