Created
January 9, 2018 09:55
-
-
Save jayserdny/f0275e5799495d8082c007e62b4e71f3 to your computer and use it in GitHub Desktop.
Login.ts for steemit tutorial
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 { AlertsProvider } from '../../providers/alerts/alerts'; | |
import { AuthProvider } from '../../providers/auth/auth'; | |
@IonicPage() | |
@Component({ | |
selector: 'page-login', | |
templateUrl: 'login.html', | |
}) | |
export class LoginPage { | |
private email: string; | |
private password: string; | |
constructor(public navCtrl: NavController, | |
public navParams: NavParams, | |
private alertsUtil: AlertsProvider, | |
private authUtil: AuthProvider) {} | |
/** | |
* | |
* Method to do login | |
* | |
*/ | |
private login(): void { | |
this.authUtil.login(this.email, this.password).then(() => { | |
this.alertsUtil.presentToast(Meteor.user().profile.name); | |
}, (error) => { | |
this.alertsUtil.showAlert(error); | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment