Permalink
Browse files

Step 17.6: Create a test login method and bind it to the user interface

  • Loading branch information...
darkbasic committed Jun 9, 2017
1 parent e6fa60b commit c2b043612470b069a622d50591958462022cdb08
Showing with 21 additions and 0 deletions.
  1. +6 −0 src/pages/login/login.html
  2. +15 −0 src/pages/login/login.ts
@@ -22,4 +22,10 @@
<ion-item>
<ion-input [(ngModel)]="phone" (keypress)="onInputKeypress($event)" type="tel" placeholder="Your phone number"></ion-input>
</ion-item>
<ion-item>
<ion-buttons>
<button ion-button (click)="loginFacebook()">Login with Facebook</button>
</ion-buttons>
</ion-item>
</ion-content>
View
@@ -50,6 +50,21 @@ export class LoginPage implements AfterContentInit {
alert.present();
}
loginFacebook(): void {
const options = {
requestPermissions: ['public_profile', 'user_friends', 'email']
};
(<any>Meteor).loginWithFacebook(options, (error: Error) => {
if (error) {
this.handleError(error);
} else {
console.log("Logged in with Facebook succesfully.");
console.log(Meteor.user());
}
});
}
handleLogin(alert: Alert): void {
alert.dismiss().then(() => {
return this.phoneService.verify(this.phone);

0 comments on commit c2b0436

Please sign in to comment.