Skip to content

Instantly share code, notes, and snippets.

@geykel

geykel/login1.ts Secret

Created March 12, 2017 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geykel/93105ed4acdcd72c759c8a7417be300a to your computer and use it in GitHub Desktop.
Save geykel/93105ed4acdcd72c759c8a7417be300a to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import { NavController, AlertController } from 'ionic-angular';
import { TabsPage } from '../tabs/tabs';
@Component({
selector: 'page-login',
templateUrl: 'login.html'
})
export class LoginPage {
credenciales = { usuario: '', contrasena: '' };
constructor(public navCtrl: NavController, public alertCtrl: AlertController) { }
iniciarSesion() {
if (this.credenciales.usuario === 'user' && this.credenciales.contrasena === '123') {
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