title: RouterLink is not working in Angular 6
body: <p>I was coding watching a Brad Traversy tutorial. and I did exactly as it is said.
  this is my 'app.module.ts'.</p>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
  import { NgModule } from '@angular/core';
  import {RouterModule, Routes} from '@angular/router';
  
  import { AppComponent } from './app.component';
  import { NavbarComponent } from './components/navbar/navbar.component';
  import { LoginComponent } from './components/login/login.component';
  import { RegisterComponent } from './components/register/register.component';
  import { HomeComponent } from './components/home/home.component';
  import { ProfileComponent } from './components/profile/profile.component';
  import { DashboardComponent } from './components/dashboard/dashboard.component';
  
  const appRoutes: Routes = [
    {path:'', component: HomeComponent},
    {path:'register', component: RegisterComponent},
    {path:'login', component: LoginComponent},
    {path:'dashboard', component: DashboardComponent},
    {path:'profile', component: ProfileComponent}
  ] 
  @NgModule({
    declarations: [
      AppComponent,
      NavbarComponent,
      LoginComponent,
      RegisterComponent,
      HomeComponent,
      ProfileComponent,
      DashboardComponent
    ],
    imports: [
      BrowserModule,
      RouterModule.forRoot(appRoutes) // appRoutes: an object
  
    ],
    providers: [],
    bootstrap: [AppComponent]
  })
  export class AppModule { }
  </code></pre>
  
  <p>this is my navbar component</p>
  
  <pre><code> &lt;li&gt;&lt;a class="nav-link" [routerLink] = "['/']" [routerLinkActive]=" 
  ['active']"&gt;Home&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a class="nav-link" [routerLink] = "['/login']" [routerLinkActive]=" 
  ['active']"&gt;Login&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>I also added </p>
  
  <pre><code>&lt;base href="/"&gt;
  </code></pre>
  
  <p>to the index.html file.</p>
  
  <p>When I remove the RouterLink part the pages are working good.it displays the content inside the components when I give the path in the URL.</p>
  
  <p>I checked in several questions. but I have done everything, I can't find an answer.</p>