简体   繁体   中英

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 don't work. Imported RoutingComponent too app.module etc.

I wouldn't say you did "everything" right. The routerLink directive is case-sensitive.

routerLink != routerlink

It must be

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM