I have been trying to route from my homepage to load other components HTML, it doesn't work. The homepage keeps showing up while the address changes to the one I set -
app.module.ts is the following:
@NgModule({
declarations: [
AppComponent,
RegisterComponent,
TabsComponent,
AboutComponent,
LessonsComponent
],
imports: [
RouterModule.forRoot([
{ path: 'tabs', component: TabsComponent},
{ path: 'register', component: RegisterComponent},
{ path: 'lessons',component: LessonsComponent},
{ path: 'about', component: AboutComponent},
{ path: 'app',component: AppComponent},
]),
these are my links in my app.component.html:
<div>
<ul class="navbar">
<li><a routerLink="/register" routerLinkActive="active">Register</a></li>
<li><a routerLink="/tabs" routerLinkActive="active">Tabs</a></li>
<li><a routerLink="/app" routerLinkActive="active">Home</a></li>
<li><a routerLink="/lessons" routerLinkActive="active">Lessons</a></li>
<li style="float:right"><a routerLink="/about" routerLinkActive="active">About</a></li>
</ul>
</div>
For example, if I press the register link I will get to "http://localhost:4200/register", but It stays on the app.component.html