Igor Simic
3 years ago

#Angular RouterLink not working?

                    <a [routerLink]="['/dashboard/profile/']">Profile</a>



                  

If routerLink does not work, here is easy fix for it.

Just import RuterModule to you app.modules.ts or to module responsible for a component where you are using [routerLink]

                    import {RouterModule} from '@angular/router';

@NgModule({
  declarations: [
    YourComponent
  ],
  imports: [
    //...
    RouterModule
  ],
  exports: []
})