In my app.module.ts
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MaterialModule,
FlexLayoutModule,
BrowserAnimationsModule,
AppRoutingModule,
HttpClientModule,
FormsModule,
ReactiveFormsModule,
MyAppModule
],
providers: [
AuthenticationService,
AuthGuardService,
MyAppService
],
bootstrap: [AppComponent]
})
export class AppModule { }
In my AuthGuardService:
@Injectable({
providedIn: 'root'
})
export class AuthGuardService implements CanActivate {
I've already put the HttpClientModule and even add providedIn in my authguard, but still I encounter this error. I am using angular 7.
Remove all the services from providers as you already have added providedIn: 'root'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With