Guest User

Untitled

a guest
Feb 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import { Component, OnInit, HostBinding } from '@angular/core';
  2. import { AngularFireAuth } from 'angularfire2/auth';
  3. import * as firebase from 'firebase/app';
  4. import { Router } from '@angular/router';
  5. import { moveIn } from '../router.animations';
  6.  
  7. @Component({
  8. selector: 'app-login',
  9. templateUrl: './login.component.html',
  10. styleUrls: ['./login.component.css'],
  11. providers: [AngularFireAuth],
  12. animations: [moveIn()],
  13. host: {'[@moveIn]': ''}
  14. })
  15. export class LoginComponent implements OnInit {
  16.  
  17. error: any;
  18. constructor(public afAuth: AngularFireAuth) { }
  19.  
  20. loginGoogle() {
  21. this.afAuth.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider());
  22. }
  23.  
  24. logout() {
  25. this.afAuth.auth.signOut();
  26. }
  27.  
  28. ngOnInit() { }
  29. }
Add Comment
Please, Sign In to add comment