-
-
Save geykel/f1052547b0434669c04b8c1a6ff67367 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 { NavController, AlertController } from 'ionic-angular'; | |
import { TabsPage } from '../tabs/tabs'; | |
import { Auth } from '../../providers/auth'; | |
@Component({ | |
selector: 'page-login', | |
templateUrl: 'login.html' | |
}) | |
export class LoginPage { | |
credenciales = { usuario: '', contrasena: '' }; | |
constructor(public navCtrl: NavController, public alertCtrl: AlertController, public auth: Auth) { } | |
iniciarSesion() { | |
if (this.auth.iniciarSesion(this.credenciales)) { | |
this.navCtrl.setRoot(TabsPage); | |
} else { | |
let alert = this.alertCtrl.create({ | |
title: 'Error', | |
subTitle: 'Usuario y/o contraseña incorrecta.', | |
buttons: ['Cerrar'] | |
}); | |
alert.present(prompt); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment