I would make it more dynamic using method parameters
Import Angular Router
import { Router } from '@angular/router';
Create button with click event
<div (click)="redirect(my-page)">My page</div>
Create a method with the pagename parameter
redirect(pagename: string) { this.router.navigate(['/'+pagename]); }
When clicked, the router should go to the correct page
0x1ad2
source share