import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; // Import Containers import { DefaultLayoutComponent, CustomerPortalLayoutComponent } from './containers'; import { P404Component } from './views/error/404.component'; import { P500Component } from './views/error/500.component'; import { LoginComponent } from './views/login/login.component'; import { RegisterComponent } from './views/register/register.component'; export const routes: Routes = [ { path: '', redirectTo: 'home', pathMatch: 'full', }, { path: 'admin', redirectTo: 'admin/dashboard', pathMatch: 'full', }, { path: '404', component: P404Component, data: { title: 'Page 404' } }, { path: '500', component: P500Component, data: { title: 'Page 500' } }, { path: 'login', component: LoginComponent, data: { title: 'Login Page' } }, { path: '', component: CustomerPortalLayoutComponent, data: { title: 'Customer Page' }, children: [ { path: 'home', loadChildren: () => import('./views/custom-portal-pages/home-page/home-page.module').then(m => m.HomePageModule) }, { path: 'products', loadChildren: () => import('./views/custom-portal-pages/products-display-view/products-display-view.module').then(m => m.ProductsDisplayViewModule) }, ] }, { path: 'register', component: RegisterComponent, data: { title: 'Register Page' } }, { path: 'admin', component: DefaultLayoutComponent, data: { title: 'Admin pages' }, children: [ { path: 'manageConfiguration', loadChildren: () => import('./views/categoryModals/category-modals.module').then(m => m.CategoryModalModule) }, { path: 'sales', loadChildren: () => import('./views/base/base.module').then(m => m.BaseModule) }, { path: 'accounts', loadChildren: () => import('./views/accounts/accounts.module').then(m => m.AccountsModule) }, { path: 'purchases', loadChildren: () => import('./views/buttons/buttons.module').then(m => m.ButtonsModule) }, { path: 'reports', loadChildren: () => import('./views/chartjs/chartjs.module').then(m => m.ChartJSModule) }, { path: 'dashboard', loadChildren: () => import('./views/dashboard/dashboard.module').then(m => m.DashboardModule) }, { path: 'icons', loadChildren: () => import('./views/icons/icons.module').then(m => m.IconsModule) }, { path: 'notifications', loadChildren: () => import('./views/notifications/notifications.module').then(m => m.NotificationsModule) }, { path: 'theme', loadChildren: () => import('./views/theme/theme.module').then(m => m.ThemeModule) }, { path: 'widgets', loadChildren: () => import('./views/widgets/widgets.module').then(m => m.WidgetsModule) }, { path: 'invoices', loadChildren: () => import('./views/invoice/invoice.module').then(m => m.InvoiceModule) }, { path: 'vendor-payments', loadChildren: () => import('./views/vendor-payment/vendor-payment.module').then(m => m.VendorPaymentsModule) }, { path: 'bills', loadChildren: () => import('./views/bill/bill.module').then(m => m.BillModule) }, { path: 'items', loadChildren: () => import('./views/products/product.module').then(m => m.ProductsModule) }, { path: 'vendor-credits', loadChildren: () => import('./views/vendor-credit/vendor-credit.module').then(m => m.VendorCreditModule) }, { path: 'vendors', loadChildren: () => import('./views/vendor-info/vendor-info.module').then(m => m.VendorInfoModule) } ] }, { path: '**', component: P404Component } ]; @NgModule({ imports: [ RouterModule.forRoot(routes), ], exports: [ RouterModule ] }) export class AppRoutingModule {}