I have a mat-sidenav in my project and I want to link a text to another URL, but when I use routerLink it doesn't work but it works out of the side-nav.it even works in the toolbar. what is the problem? here are my codes: HTML:
<mat-toolbar>
<mat-toolbar-row>
<div>
<button mat-icon-button class="button" (click)="sidemenu.toggle()">
<mat-icon class="menu">menu</mat-icon>
</button>
</div>
<div mat-card-avatar class="example-header-image"></div>
</mat-toolbar-row>
</mat-toolbar>
<mat-sidenav-container>
<mat-sidenav mode="side" opened #sidemenu>
</mat-sidenav>
<mat-sidenav-content>
<div routerLink="/">home</div>
</mat-sidenav-content>
<router-outlet></router-outlet>
</mat-sidenav-container>