I made a small project using angular CLI but i don't know how to declare default route in CLI. I used '/' for parent component and it works but if i use '/' for child component it does not work.
My parent.component.ts is:
@Routes([
{ path: '/', component: LoginComponent },
])
parent.component.html is:
<a [routerLink]="['/Login']"></a>
<router-outlet></router-outlet>
child.component.ts is:
@Routes([
{ path: '/', component: DashboardComponent},
])
child.component.html is:
<li class="treeview">
<a [routerLink]="['']">Dashboard</a>
</li>
<router-outlet></router-outlet>
This method works with parent and child both but i want a route with another path e.g. "/dashboard" as default. Is there any way to define default route in child component.