Created
October 24, 2018 13:46
-
-
Save shamique/a7877d76125f4c74bf672b634dab2dd7 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, NavParams, LoadingController } from "ionic-angular"; | |
import { CognitoServiceProvider } from "../../providers/cognito-service/cognito-service"; | |
import { SignUpPage } from "../../pages/sign-up/sign-up"; | |
import { ImageUploadPage } from "../../pages/image-upload/image-upload"; | |
@Component({ | |
selector: "page-login", | |
templateUrl: "login.html" | |
}) | |
export class LoginPage { | |
email: string; | |
password: string; | |
signUpPage = SignUpPage; | |
constructor(public navCtrl: NavController, public CognitoSerive: CognitoServiceProvider, public loadingCtrl: LoadingController) {} | |
login() { | |
let loading = this.loadingCtrl.create(); | |
loading.present(); | |
this.CognitoSerive.authenticate(this.email, this.password).then( | |
res => { | |
loading.dismiss(); | |
this.navCtrl.push(ImageUploadPage); | |
}, | |
err => { | |
console.log(err); | |
} | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment