Angular - How to fix "ERROR TS2322: Type 'ModuleWithProviders<any>' is not assignable to type 'any[] | Type<any>'"
As i see, you have added Modules under declarations and components under imports, you should add Modules under imports and components under declarations.
declarations
is savecomponents
,pipes
ordirectives
.imports
is savemodules
.
@NgModule({
// right
imports: [
BrowserAnimationsModule,
FormsModule,
HttpClientModule,
ComponentsModule,
RouterModule,
AppRoutingModule,
NgbModule,
ToastrModule.forRoot()
],
// right
declarations: [
AppComponent,
AdminLayoutComponent
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }