Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

using fb login with angular app

npm install --save angularx-social-login
Comment

using fb login with angular app

const config = new AuthServiceConfig([
  {
    id: FacebookLoginProvider.PROVIDER_ID,
    provider: new FacebookLoginProvider('2203659926599837')
  }
]);

export function provideConfig() {
  return config;
}
Comment

using fb login with angular app

providers: [
  {
    provide: AuthServiceConfig,
    useFactory: provideConfig
  }
],
Comment

using fb login with angular app

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

using fb login with angular app

imports: [
  ...
  MatIconModule,
  MatButtonModule,
  MatCardModule
],
Comment

using fb login with angular app

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

using fb login with angular app

export class AppComponent implements OnInit {
  ...
}
Comment

using fb login with angular app

signInWithFB(): void {
  this.authService.signIn(FacebookLoginProvider.PROVIDER_ID);
}

signOut(): void {
  this.authService.signOut();
}
Comment

using fb login with angular app

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

PREVIOUS NEXT
Code Example
Javascript :: Prevent Double tap in React native 
Javascript :: javascript ascii character a to z 
Javascript :: redux saga fetch data using axios 
Javascript :: how to practice javascript 
Javascript :: if statement in react native 
Javascript :: get yyyy-mm-dd hh:mm from date javascript 
Javascript :: full month name using moment 
Javascript :: How to Check if a Substring is in a String in JavaScript Using the includes() Method 
Javascript :: ejemplo archivo json 
Javascript :: wavesurf js 
Javascript :: json schema validator allows null 
Javascript :: how to append object in array javascript 
Javascript :: js reverse string 
Javascript :: split and convert a string into object 
Javascript :: javascript slice and substring 
Javascript :: how to get csrf token in javascript 
Javascript :: set embed color discord.js 
Javascript :: javascript constant variable 
Javascript :: maximum sum array algorithm javascript 
Javascript :: javascript for...of with Strings 
Javascript :: responseText js 
Javascript :: manage nodejs versions on windows 
Javascript :: jquery validate on keyup 
Javascript :: difference between normal function and arrow function 
Javascript :: js get class from instance 
Javascript :: angular style component tag 
Javascript :: node js split 
Javascript :: log error line node.js 
Javascript :: nuxt import css 
Javascript :: monaco editor events 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =