title: How to add routelink active to child routes also
body: <p>I have a html file as follows.</p>
  
  <pre><code> &lt;ul class="nav side-menu"&gt;
                  &lt;li routerLinkActive="active"&gt;
                    &lt;a routerLink="Teachers/AllTeachers"&gt;
                      Teachers 
                    &lt;/a&gt;
                  &lt;/li&gt;
   &lt;/ul&gt;
  </code></pre>
  
  <p>In this html file i.e in teacher.component.ts i am redirecting to all teachers component as shown abouve. 
  In my app.routing.ts my routes are as follows.</p>
  
  <pre><code>    const routes: Routes = [
          { path: '', component: LoginComponentComponent },
          {
              path: 'Dashboard', component: SidebarComponent, canActivate: [OnlyLoggedInGuard],
              children: [
                  { path: 'Teachers/AllTeachers', component: AllTeachersComponent},
                  { path: 'Teachers/AddTeacher', component: AddTeacherComponent},
  ]
  },
  </code></pre>
  
  <p>now i have to navigate from all teachers to add teacher from all teachers component .I am doing it by clicking another button. But on doing this the routerlink active is not working it is not applying the active class to html.I need to keep the li active as long as it is there in teachers.</p>