Answer the question
In order to leave comments, you need to log in
Why is routerLink throwing an error?
header.component.html
<div class="actions-block">
<button class="login-button" [routerlink]="'/sign-in'">Sign In</button>
</div>
@NgModule({
declarations: [HeaderComponent],
imports: [CommonModule, RouterModule],
exports: [HeaderComponent, RouterModule],
})
export class HeaderModule {}
Can't bind to 'routerlink' since it isn't a known property of 'button'.
Answer the question
In order to leave comments, you need to log in
[routerLink]="/sign-in".
In general, it is not clear why you have header.module.ts? Each module is a chunk that will be loaded when switching to this module. Or if you have a large separation of components. If you do not need it, then you will have 1 module - app.module.ts (here are all declarations, imports, providers, etc.) and one app-routing.module.ts (all your routes)).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question