0

I have a service that records page activity with the NavigationEnd event from router.events

Am I able to change the url without changing/displaying new children components?

Right now I have

{
    path: '',
    component: MainComponent,
    children: [
        { path: '**', component: DummyRoutingComponent}   
    ]
}

DummyRoutingComponent displays nothing.

This way I can routerLink="what-ever-I-want" and have it get recorded by my service. I realize this has some issues if the page were to grow more.

Is there a better way to achieve my results?

ghoul
  • 890
  • 1
  • 10
  • 17
  • You have a service that records route activity, but at the sametime all your routes display a dummy component. Please explain what would be the point of recording such meaningless activity? – Reactgular May 24 '19 at 19:20
  • @cgTag My code is general here, this is one portion of the app, I should have made that more clear within the question. the dummy routes are used in this part of the app (something like `app/(section)/(area)/**` the `**` represents route changes but no component changes. I know i could add service calls and manual add the activity recording but if it's possible similar to how im doing it now it's really convenient. – ghoul May 24 '19 at 19:25

0 Answers0