error alerts on wrong login
parent
ada52bc23f
commit
2ac250c837
@ -0,0 +1,35 @@
|
||||
<!--
|
||||
Generated template for the ErrorPage page.
|
||||
|
||||
See http://ionicframework.com/docs/components/#navigation for more info on
|
||||
Ionic pages and navigation.
|
||||
-->
|
||||
<ion-header>
|
||||
|
||||
<ion-navbar>
|
||||
<ion-title> Error ({{error.message}})</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
There was an error when trying to login. The error code is:<code>{{error.message}}</code>.
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<p> {{errorMessages[error.message]}} </p>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col col-8>
|
||||
</ion-col>
|
||||
<ion-col col-4>
|
||||
<ion-item>
|
||||
<button full ion-button (click)="dismissModal()" color="secondary">
|
||||
Okay
|
||||
</button>
|
||||
</ion-item>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-content>
|
@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from 'ionic-angular';
|
||||
import { ErrorPage } from './error';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ErrorPage,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(ErrorPage),
|
||||
],
|
||||
})
|
||||
export class ErrorPageModule {}
|
@ -0,0 +1,3 @@
|
||||
page-error {
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams, ViewController } from 'ionic-angular';
|
||||
|
||||
/**
|
||||
* Generated class for the ErrorPage page.
|
||||
*
|
||||
* See https://ionicframework.com/docs/components/#navigation for more info on
|
||||
* Ionic pages and navigation.
|
||||
*/
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
selector: 'page-error',
|
||||
templateUrl: 'error.html',
|
||||
})
|
||||
export class ErrorPage {
|
||||
public error = this.navParams.data
|
||||
public errorMessages = {
|
||||
403:"Please check your username and password and try again! ",
|
||||
500:"There seems to be no connection to the OSeM"
|
||||
}
|
||||
|
||||
constructor(public navCtrl: NavController, public navParams: NavParams,public view: ViewController) {
|
||||
}
|
||||
dismissModal(){
|
||||
this.view.dismiss();
|
||||
}
|
||||
ionViewDidLoad() {
|
||||
console.log('ionViewDidLoad ErrorPage');
|
||||
console.log(this.navParams)
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue