angular facebook login code example

Example 1: using fb login with angular app

npm install --save angularx-social-login

Example 2: using fb login with angular app

ngOnInit() {
  this.authService.authState.subscribe((user) => {
    this.user = user;
    this.loggedIn = (user != null);
    console.log(this.user);
  });
}

Example 3: using fb login with angular app

import {
  MatIconModule,
  MatButtonModule,
  MatCardModule } from '@angular/material';

Example 4: using fb login with angular app

import { AuthService, FacebookLoginProvider, SocialUser } from 'angularx-social-login';

Example 5: using fb login with angular app

export class AppComponent implements OnInit {
  ...
}