fix
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<widget id="com.coregrade.users" version="10.0.13" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
<widget id="com.coregrade.users" version="10.0.14" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||||
<name>CoreGrade</name>
|
<name>CoreGrade</name>
|
||||||
<description>Intelligent Learning Platform.</description>
|
<description>Intelligent Learning Platform.</description>
|
||||||
<author email="support@coregrade.com" href="https://www.coregrade.com/">CoreGrade</author>
|
<author email="support@coregrade.com" href="https://www.coregrade.com/">CoreGrade</author>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
|
import { AlertController } from '@ionic/angular';
|
||||||
|
|
||||||
|
AlertController
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
@@ -9,13 +11,37 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class LoginPage implements OnInit {
|
export class LoginPage implements OnInit {
|
||||||
|
|
||||||
constructor( private router:Router) { }
|
@ViewChild('username', { static: false }) username;
|
||||||
|
@ViewChild('password', { static: false }) password;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private alertCtrl: AlertController,
|
||||||
|
private router: Router
|
||||||
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
onStartLogin(){
|
async onStartLogin() {
|
||||||
this.router.navigateByUrl('tabs');
|
if (this.username == null || this.username === '' /* || this.floatValidatorsProvider.validateEmail(this.username) === false */
|
||||||
|
|| this.password == null || this.password === '') {
|
||||||
|
this.showAlert('Invalid Login', 'Enter username(email) and password to login');
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.router.navigateByUrl('tabs');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async showAlert(mtitle: string, amessage: string) {
|
||||||
|
const alert = await this.alertCtrl.create({
|
||||||
|
header: mtitle,
|
||||||
|
message: amessage,
|
||||||
|
buttons: ['OK']
|
||||||
|
});
|
||||||
|
alert.present();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user