From 383a88325590d4bdb5bf5ff56106e4e373c2e3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Fri, 3 Jan 2025 12:53:05 +0300 Subject: [PATCH] Update routes --- src/routes.ts | 17 +++++++++++++++++ src/views/pages/auth/auth.routes.ts | 9 +++------ src/views/pages/pages.routes.ts | 15 +++++---------- src/views/uikit/uikit.routes.ts | 18 ++++++++++++++++++ 4 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 src/routes.ts create mode 100644 src/views/uikit/uikit.routes.ts diff --git a/src/routes.ts b/src/routes.ts new file mode 100644 index 0000000..338fa61 --- /dev/null +++ b/src/routes.ts @@ -0,0 +1,17 @@ +import { Routes } from '@angular/router'; +import { AppLayout} from '@/src/layout/applayout'; + +export const routes: Routes = [ + { + path: '', component: AppLayout, + children: + [ + { path: '', loadComponent: () => import('./views/dashboard').then(c => c.Dashboard) }, + { path: 'uikit', loadChildren: () => import('./views/uikit/uikit.routes')}, + { path: 'pages', loadChildren: () => import('./views/pages/pages.routes')}, + {path: 'documentation', loadComponent: () => import('./views/pages/documentation').then(c => c.Documentation)} + ] + }, + { path: 'auth', loadChildren: () => import('./views/pages/auth/auth.routes')}, + { path: '**', redirectTo: '/notfound' }, +]; diff --git a/src/views/pages/auth/auth.routes.ts b/src/views/pages/auth/auth.routes.ts index 3b19fd9..c586c9e 100644 --- a/src/views/pages/auth/auth.routes.ts +++ b/src/views/pages/auth/auth.routes.ts @@ -1,10 +1,7 @@ import { Routes } from '@angular/router'; -import { Access } from './access'; -import { Login } from './login'; -import { Error } from './error'; export default [ - { path: 'access', component: Access}, - { path: 'error', component: Error}, - { path: 'login', component: Login}, + { path: 'access', loadComponent: () => import('./access').then(c => c.Access)}, + { path: 'error', loadComponent: () => import('./error').then(c => c.Error)}, + { path: 'login', loadComponent: () => import('./login').then(c => c.Login)}, ] as Routes; diff --git a/src/views/pages/pages.routes.ts b/src/views/pages/pages.routes.ts index 4be35c6..9c82b5b 100644 --- a/src/views/pages/pages.routes.ts +++ b/src/views/pages/pages.routes.ts @@ -1,15 +1,10 @@ import { Routes } from '@angular/router'; -import {Documentation} from './documentation'; -import {Crud} from './crud'; -import {Landing} from './landing'; -import {Empty} from './empty'; -import {Notfound} from './notfound'; export default [ - { path: 'documentation', component: Documentation}, - { path: 'crud', component: Crud}, - { path: 'landing', component: Landing}, - { path: 'empty', component: Empty}, - { path: 'notfound', component: Notfound}, + { path: 'documentation', loadComponent: () => import('./documentation').then(c => c.Documentation)}, + { path: 'crud', loadComponent: () => import('./crud').then(c => c.Crud)}, + { path: 'landing', loadComponent: () => import('./landing').then(c => c.Landing)}, + { path: 'empty', loadComponent: () => import('./empty').then(c => c.Empty)}, + { path: 'notfound', loadComponent: () => import('./notfound').then(c => c.Notfound)}, { path: '**', redirectTo: '/notfound' } ] as Routes; diff --git a/src/views/uikit/uikit.routes.ts b/src/views/uikit/uikit.routes.ts new file mode 100644 index 0000000..9a9382c --- /dev/null +++ b/src/views/uikit/uikit.routes.ts @@ -0,0 +1,18 @@ +import { Routes } from '@angular/router'; + +export default [ + { path: 'button', data: { breadcrumb: 'Button' }, loadComponent: () => import('./buttondoc').then(c => c.ButtonDoc) }, + { path: 'charts', data: { breadcrumb: 'Charts' }, loadComponent: () => import('./chartdoc').then(c => c.ChartDoc) }, + { path: 'file', data: { breadcrumb: 'File' }, loadComponent: () => import('./filedoc').then(c => c.FileDoc) }, + { path: 'formlayout', data: { breadcrumb: 'Form Layout' }, loadComponent: () => import('./formlayoutdoc').then(c => c.FormLayoutDoc) }, + { path: 'input', data: { breadcrumb: 'Input' }, loadComponent: () => import('./inputdoc').then(c => c.InputDoc) }, + { path: 'list', data: { breadcrumb: 'List' }, loadComponent: () => import('./listdoc').then(c => c.ListDoc) }, + { path: 'media', data: { breadcrumb: 'Media' }, loadComponent: () => import('./mediadoc').then(c => c.MediaDoc) }, + { path: 'message', data: { breadcrumb: 'Message' }, loadComponent: () => import('./messagesdoc').then(c => c.MessagesDoc) }, + { path: 'misc', data: { breadcrumb: 'Misc' }, loadComponent: () => import('./miscdoc').then(c => c.MiscDoc) }, + { path: 'panel', data: { breadcrumb: 'Panel' }, loadComponent: () => import('./panelsdoc').then(c => c.PanelsDoc) }, + { path: 'table', data: { breadcrumb: 'Table' }, loadComponent: () => import('./tabledoc').then(c => c.TableDoc) }, + { path: 'tree', data: { breadcrumb: 'Tree' }, loadComponent: () => import('./treedoc').then(c => c.TreeDoc) }, + { path: 'menu', data: { breadcrumb: 'Menu' }, loadComponent: () => import('./menudoc').then(c => c.MenuDoc) }, + { path: '**', redirectTo: '/notfound' } +] as Routes;