Angular 4 How the parent component can know that the children's route is open

Viewed 65

I have structure of routes:

{
    path: '',
    component: LibraryComponent
   ,
    children: [
      {
        path: '',
        component: LibraryPageComponent
      },
      {
        path: 'online-learning',
        component: LibraryCoursesPageComponent   
      },
      {
        path: 'events',
        component: LibraryEventsPageComponent,
        }

    // another children
      ]

}

For example: If my current route 'online-learning' or another route of children, how the parent component can know that the children's route is open?

May be is some method or value in ActivatedRoute.

P.S. Is there solution without parsing url?

Thanks!

0 Answers
Related