amal ghaida

amal ghaida

  • NA
  • 20
  • 819

dashboard is not loading

Nov 30 2022 7:42 AM

In App.routing

In App routing

const routes: Routes = [
  { path: '', redirectTo: 'login', pathMatch: 'full' },
  { path: 'login', component: LoginComponent },
  { path: 'dashboard', loadChildren: () => import('./admin.module').then(m => m.AdminModule)}]

@NgModule({
  imports: [
    RouterModule.forRoot(routes)
  ],
  exports: [RouterModule]
})

in the Admin routing

const routes: Routes = [
  {
    path: '', component: AdminComponent,
    children: [
      { path: '', component: DashboardComponent }
    ]
  }
];
@NgModule({
  imports: [
    RouterModule.forChild(routes)
  ],
  exports: [RouterModule]
})

<router-outlet></router-outlet> in the AdminComponent.html

Answers (1)