Bonsoir,

Je reçois ce message d'erreur alors que je pense avoir bien tout déclarer.

ERROR in src/app/app.routes.ts:19:6 - error TS2322: Type '{ path: string; Component: typeof MatchDetailComponent; }' is not assignable to type 'Route'.
Object literal may only specify known properties, but 'Component' does not exist in type 'Route'. Did you mean to write 'component'?
Avez vous une idée ?

fichier : app.route.ts

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { Routes } from '@angular/router'
import { HomeComponent }  from './pages/home/home.component'
import { MatchListComponent } from './resources/matches/match-list/match-list.component'
import { MatchDetailComponent } from './resources/matches/match-detail/match-detail.component'
 
 
export const  appRoutes: Routes = [
   {
       path: '',
       component: HomeComponent
   },
  {
      path: 'matches',
      component: MatchListComponent
  },
 {
     path: 'matches/:id',
 
     Component: MatchDetailComponent
 } 
]
fichier app.modules.ts

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router'
 
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HeaderComponent } from './partials/header/header.component';
import { HomeComponent } from './pages/home/home.component';
import { MatchListComponent } from './resources/matches/match-list/match-list.component';
import { MatchDetailComponent } from './resources/matches/match-detail/match-detail.component';
import { appRoutes } from './app.routes';
 
@NgModule({
  declarations: [
    AppComponent,
    HeaderComponent,
    HomeComponent,
    MatchListComponent,
    MatchDetailComponent
  ],
  imports: [BrowserModule, RouterModule.forRoot(appRoutes)
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }