angular router cahnges url but dose not load the compoents / pages

i have this nav component

<div class="mx">
  <ul class="xv">
    <li
      *ngFor="let item of items"
      class="main-nav__item main-nav__item--{{ item.theme }}"
    >
      <a
        routerLink="{{ item.category == 'home' ? '' : item.endpoint }}"
        routerLinkActive="active"
        [routerLinkActiveOptions]="{ exact: true }"
        >{{ item.title }} </a>
    </li>
  </ul>
</div>
</nav>

in the app-routing

  {
    path: ":section/:layout/:layout_2/:site/:section",
    component: HomePageComponent,
  },

  {
    path: ":site/:section/:year/:month/:day/:title",
    pathMatch: "full",
    component: ArticlePageComponent

  },
 {
    path: "",
    pathMatch: "full",
    component: HomePageComponent
  },
...

so I’m loading the same component but with different data e.gHomePageComponent

so the router only move to a section page from the root/home page
but if in section page already it won’t switch to another section page only go back to home page

77 thoughts on “angular router cahnges url but dose not load the compoents / pages”

Leave a Comment