Skip to content

Instantly share code, notes, and snippets.

@shamique
Created October 24, 2018 13:46
Show Gist options
  • Save shamique/a7877d76125f4c74bf672b634dab2dd7 to your computer and use it in GitHub Desktop.
Save shamique/a7877d76125f4c74bf672b634dab2dd7 to your computer and use it in GitHub Desktop.
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