I get error on navigation from 2 different nested routes

Whenever I try to navigate from 2 different nested routes I get this error

Error

I am trying to logout from a portal routing from (patient/dashboard) to (auth/login) using the header component (shared module)

<nz-layout>
  <app-header></app-header>
  <nz-content>
    <router-outlet></router-outlet>
  </nz-content>
  <app-footer></app-footer>
</nz-layout>
  • header.html
 <button mat-menu-item (click)="onLogout()">
     <mat-icon>logout</mat-icon>
     <span>Logout</span>
  </button>
  • header.ts
  onLogout() {
    this.router.navigate(['/auth/login']);
  }


Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)