Reputation: 84
const routes: Routes = [ { path: '', component: DraftAnalysisHomeComponent }, { path: 'nfldraftanalysis', component: DraftAnalysisHomeComponent }, {
path: 'nfldraftanalysis/averagegrades',
component: AverageGradeComponent,
children: [
{
path: '?year=:year&teamname=:team',
component: AverageGradeDetailsComponent,
},
], }, {
path: 'nfldraftanalysis/averagegradeswithsteal',
component: AverageGradeWithStealComponent, }, { path: 'nfldraftanalysis/about', component: AboutComponent }, { path: '**', component: NotFoundComponent }, ]
When the route is navigated to "http://localhost:4200/nfldraftanalysis/averagegrades?year=:year&teamname=:team", it doesn't pick up the child component but it renders the parent component view. How to avoid this behavior?
Upvotes: 0
Views: 40
Reputation: 6424
As apposed to Url parameters
which should be registered by RouteModule
, Query parameters
should not.
Upvotes: 1