komponents erstellen

This commit is contained in:
Tizian.Breuch
2025-09-08 18:17:32 +02:00
parent 27cfa1e925
commit ee8974e2ff
71 changed files with 1627 additions and 27 deletions

View File

@@ -1,5 +1,8 @@
import { Routes } from '@angular/router';
import { AccessDeniedComponent } from './core/components/access-denied/access-denied.component';
import { NotFoundComponent } from './core/components/not-found/not-found.component';
export const routes: Routes = [
// Regel 1: Leerer Pfad (Startseite der Anwendung)
// Ein Benutzer, der die Haupt-URL Ihrer Seite aufruft (z.B. "http://localhost:4200/"),
@@ -7,20 +10,28 @@ export const routes: Routes = [
{
path: '',
redirectTo: 'auth', // Leitet zur /auth-Route weiter
pathMatch: 'full' // Wichtig: Gilt nur für den exakt leeren Pfad
pathMatch: 'full', // Wichtig: Gilt nur für den exakt leeren Pfad
},
// Regel 2: Authentifizierungs-Feature
// Alle URLs, die mit "auth/" beginnen (z.B. "/auth/login", "/auth/register"),
// werden von dieser Regel abgefangen und an die auth.routes.ts zur
// weiteren Verarbeitung übergeben.
{
path: 'auth',
loadChildren: () => import('./features/auth/auth.routes').then(r => r.AUTH_ROUTES)
loadChildren: () =>
import('./features/auth/auth.routes').then((r) => r.AUTH_ROUTES),
},
{
path: 'demo',
loadChildren: () => import('./features/demo/demo.routes').then(r => r.DEMO_ROUTES)
loadChildren: () =>
import('./features/demo/demo.routes').then((r) => r.DEMO_ROUTES),
},
{
path: 'access-denied',
component: AccessDeniedComponent,
title: 'Zugriff verweigert',
},
// Regel 3: Fallback-Route (Wildcard)
@@ -29,6 +40,7 @@ export const routes: Routes = [
// Das stellt sicher, dass Benutzer immer auf einer validen Seite landen.
{
path: '**',
redirectTo: 'auth'
}
];
component: NotFoundComponent,
title: '404 - Seite nicht gefunden',
},
];