Angular 9: Can't resolve all parameters for AuthService: (?)

453 views
Skip to first unread message

Frijx Frijx

unread,
Apr 6, 2020, 4:01:41 PM4/6/20
to Angular and AngularJS discussion
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule } from '@angular/common/http';    
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { GoogleLoginProvider, FacebookLoginProvider, AuthService } from 'angular-6-social-login';    
import { SocialLoginModule, AuthServiceConfig } from 'angular-6-social-login';    
import { LoginComponent } from './login/login.component';
import { DashboardComponent } from './dashboard/dashboard.component';
export function socialConfigs() {    
 const config = new AuthServiceConfig(    
   [    
     {    
       id: FacebookLoginProvider.PROVIDER_ID,    
       provider: new FacebookLoginProvider('appid')    
     },    
     {    
       id: GoogleLoginProvider.PROVIDER_ID,    
       provider: new GoogleLoginProvider('appid')    
     }    
   ]    
 );    
 return config;    
}    
@NgModule({
 declarations: [
   AppComponent,
   LoginComponent,
   DashboardComponent
 ],
 imports: [
   BrowserModule,
   HttpClientModule,
   AppRoutingModule
 ],
 providers: [
   AuthService,    
   {    
     provide: AuthServiceConfig,    
     useFactory: socialConfigs    
   }    ],
 bootstrap: [AppComponent]
})
export class AppModule { }



Hi I keep getting the following Error - Can't resolve all parameters for AuthService: (?) Im not too sure what I'm actually missing. I'm trying to follow this tutorial and nothing seems to be working https://www.c-sharpcorner.com/article/login-with-facebook-and-google-using-angular-8/
Any help will be much appreciated, I am new to angular 8/
Reply all
Reply to author
Forward
0 new messages