如何在ngx管理入门套件中添加新组件及其路由



我想使用ngx管理主题创建一个全新的web应用程序。我创建了一个名为"OPERATION"的新组件。但是,我无法找到它的路线。在路由方面需要帮助。。提前感谢。。。

首先需要导入组件,并将组件路由添加到app-routing.module.ts中的路由中。以下是ngx管理app-routing.module.ts.中的路由

const routes: Routes = [
{
path: 'pages',
loadChildren: () => import('./pages/pages.module')
.then(m => m.PagesModule),
},
{
path: 'auth',
component: NbAuthComponent,
children: [
{
path: '',
component: NbLoginComponent,
},
{
path: 'login',
component: NbLoginComponent,
},
{
path: 'register',
component: NbRegisterComponent,
},
{
path: 'logout',
component: NbLogoutComponent,
},
{
path: 'request-password',
component: NbRequestPasswordComponent,
},
{
path: 'reset-password',
component: NbResetPasswordComponent,
},
],
},
{ path: '', redirectTo: 'pages', pathMatch: 'full' },
{ path: '**', redirectTo: 'pages' },
];

最新更新