0

I have following code

{
    path: 'clientReports',
    component: ClientsRootComponent,
    children: [
        {
            path: ':reportId',
            component: ClientsReportComponent,          
            children: [
                {
                    path: ':countryId/:branchId',
                    component: ClientsGridComponent,                    
                }
            ]
        }
    ]
}

and following links

app/clientReports/1/1/1
app/clientReports/2/1/1
app/clientReports/3/1/1

Whenever I click a link I can see that ClientsReportComponent does not reload and instead existing one is being reused and caused me problem with the services lifetime that are declared in the providers of this component.

Shouldn't be the component ClientsReportComponent reloaded every time a new link is clicked?

pantonis
  • 5,601
  • 12
  • 58
  • 115

1 Answers1

0

Yes, If you are already in same component it wont reload the component. If you want to do something on route param changes the component you are already in, then you have to subscribe for queryParam/routeparam changes.

Please find below stack link

Router Param Changes

rijin
  • 1,709
  • 12
  • 21