Angular Routerlink 不工作,我做对了

Angular Routerlink is not working and I did everything right

  <nav>
    <a routerlink="/students"><button mat-stroked-button class="button"><mat-icon class="icon">face</mat-icon><br><br><br>students</button></a>
  </nav>
const routes: Routes = [
  {path: 'students', component: StudentsComponent},
];

angular routerlink 不工作。将路由组件导入 app.module 等

我不会说你“每件事”都做对了。 routerLink 指令区分大小写。

routerLink != routerlink

一定是

<nav>
  <a routerLink="/students">
    <button mat-stroked-button class="button">
      <mat-icon class="icon">face</mat-icon><br><br><br>
      students
    </button>
  </a>
</nav>