Created
January 27, 2017 10:51
-
-
Save letsjustfixit/29ab1801e57723fa58e39128e8871cda 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 { NgForm } from '@angular/forms'; | |
import { NavController } from 'ionic-angular'; | |
import { SignupPage } from '../signup/signup'; | |
import { TabsPage } from '../tabs/tabs'; | |
import { UserData } from '../../providers/user-data'; | |
@Component({ | |
selector: 'page-user', | |
templateUrl: 'login.html' | |
}) | |
export class LoginPage { | |
login: {username?: string, password?: string} = {}; | |
submitted = false; | |
constructor(public navCtrl: NavController, public userData: UserData) { } | |
onLogin(form: NgForm) { | |
this.submitted = true; | |
if (form.valid) { | |
this.userData.login(this.login.username); | |
this.navCtrl.push(TabsPage); | |
} | |
} | |
onSignup() { | |
this.navCtrl.push(SignupPage); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment