i am using angular 7 when routerLink not working when i click on anchor button it's not working

Discussão em 'Angular' iniciado por abubakkar tahir, Agosto 18, 2025.

  1. in angular 7 i have define different component app folder and define component in route is well when i definde router name in url it,s work fine show me that component which is attached to that url but when i define that rout name in anchor tag click on anchor it,s not working here is my html code

    <li class="nav-item">
    <a class="nav-link" routerLink="/home">Home</a>
    </li>
    <li class="nav-item @@about">
    <a class="nav-link" routerLink="/about">About</a>
    </li>
    <li class="nav-item @@blog">
    <a class="nav-link" routerLink="/blog">BLOG</a>
    </li>


    this is my router

    const routes: Routes = [{
    path: '',
    redirectTo: 'home',
    pathMatch: 'full'
    },
    {
    path: 'home',
    component: HomeComponent
    },
    {
    path: 'about',
    component: AboutComponent
    },
    {
    path: 'blog',
    component: BlogComponent
    },
    ];

    Continue reading...

Compartilhe esta Página