У меня проблема с добавлением простого правила к угловому. Я следую инструкции (https://codecraft.tv/courses/angular/routing/route-configuration/), и мой код выглядит следующим образом:
app.module.ts
import {Routes, RouterModule} from "@angular/router";
const routes: Routes = [
{ path: '', component: HomeComponent },
];
@NgModule({
declarations: [
AppComponent,
HeaderComponent,
ContentComponent,
FooterComponent,
CuriositiesComponent,
HomeComponent,
RouterModule.forRoot(routes, {useHash: true}),
],
imports: [
BrowserModule,
SwiperModule
],
providers: [],
bootstrap: [AppComponent]
})
К сожалению, во время компиляции возникает какая-то ошибка, и я не знаю, в чем проблема:
ERROR in src/app/app.module.ts(20,11): error TS2345: Argument of type '{ declarations: (ModuleWithProviders | typeof HomeComponent | typeof AppComponent)[]; imports: (t...' is not assignable to parameter of type 'NgModule'.
Types of property 'declarations' are incompatible.
Type '(ModuleWithProviders | typeof HomeComponent | typeof AppComponent)[]' is not assignable to type '(any[] | Type<any>)[]'.
Type 'ModuleWithProviders | typeof HomeComponent | typeof AppComponent' is not assignable to type 'any[] | Type<any>'.
Type 'ModuleWithProviders' is not assignable to type 'any[] | Type<any>'.
Type 'ModuleWithProviders' is not assignable to type 'Type<any>'.
Property 'apply' is missing in type 'ModuleWithProviders'.