Created
June 2, 2017 00:42
-
-
Save alcidesjunior/18f6ae5ea59f74a89258b79a219fa09d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { IonicPage, NavController, NavParams } from 'ionic-angular'; | |
import { ToastController } from 'ionic-angular'; | |
import { HomePage } from '../home/home'; | |
/** | |
* Generated class for the LoginPage page. | |
* | |
* See http://ionicframework.com/docs/components/#navigation for more info | |
* on Ionic pages and navigation. | |
*/ | |
@IonicPage() | |
@Component({ | |
selector: 'page-login-page', | |
templateUrl: 'login-page.html', | |
}) | |
export class LoginPage { | |
login = {}; | |
constructor(public navCtrl: NavController, | |
public navParams: NavParams, | |
public toastCtrl: ToastController) { | |
} | |
do_login(login){ | |
if((login.user=="alcides") && (login.pwd="123")){ | |
this.navCtrl.push(HomePage); | |
}else{ | |
let toast = this.toastCtrl.create({ | |
message: 'Usuário ou senha inválidos', | |
duration: 3000, | |
position: 'bottom' | |
}); | |
toast.present(); | |
} | |
} | |
ionViewDidLoad() { | |
console.log('ionViewDidLoad LoginPage'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment