Use loadComponent for routes and cleanup
Switch route definitions to lazy-load components via loadComponent dynamic imports and remove direct component references from RouterConstants. Remove several components' standalone flags and adjust component metadata (styleUrl vs styleUrls) and imports accordingly. Make AlgorithmsService and AlgorithmsComponent synchronous (getCategories() now returns an array and template iterates categories directly). Replace alert in PathfindingComponent with MatSnackBar and inject it. Simplify LanguageService initialization to use existing translate configuration. Remove unused ReloadService. Make GenericGridComponent.lastCell protected. Miscellaneous tidy-ups across related files.
This commit is contained in:
1 parent
f46a1ed0bf
commit
5c97667ec1
16 files changed
+32
-99
No files matched your search
@@ -1,88 +1,63 @@
|
||||
import {AboutComponent} from '../pages/about/about.component';
|
||||
import {ProjectsComponent} from '../pages/projects/projects.component';
|
||||
import {ImprintComponent} from '../pages/imprint/imprint.component';
|
||||
import {AlgorithmsComponent} from '../pages/algorithms/algorithms.component';
|
||||
import {PathfindingComponent} from '../pages/algorithms/pathfinding/pathfinding.component';
|
||||
import {SortingComponent} from '../pages/algorithms/sorting/sorting.component';
|
||||
import {ConwayGolComponent} from '../pages/algorithms/conway-gol/conway-gol.component';
|
||||
import {LabyrinthComponent} from '../pages/algorithms/pathfinding/labyrinth/labyrinth.component';
|
||||
import {FractalComponent} from '../pages/algorithms/fractal/fractal.component';
|
||||
import {Fractal3dComponent} from '../pages/algorithms/fractal3d/fractal3d.component';
|
||||
import PendulumComponent from '../pages/algorithms/pendulum/pendulum.component';
|
||||
import {ClothComponent} from '../pages/algorithms/cloth/cloth.component';
|
||||
|
||||
export class RouterConstants {
|
||||
export class RouterConstants {
|
||||
|
||||
static readonly ABOUT = {
|
||||
PATH: 'about',
|
||||
LINK: '/about',
|
||||
COMPONENT: AboutComponent
|
||||
};
|
||||
|
||||
static readonly PROJECTS = {
|
||||
PATH: 'projects',
|
||||
LINK: '/projects',
|
||||
COMPONENT: ProjectsComponent
|
||||
};
|
||||
|
||||
static readonly ALGORITHMS = {
|
||||
PATH: 'algorithms',
|
||||
LINK: '/algorithms',
|
||||
COMPONENT: AlgorithmsComponent
|
||||
};
|
||||
|
||||
static readonly PATHFINDING = {
|
||||
PATH: 'algorithms/pathfinding',
|
||||
LINK: '/algorithms/pathfinding',
|
||||
COMPONENT: PathfindingComponent
|
||||
};
|
||||
|
||||
static readonly SORTING = {
|
||||
PATH: 'algorithms/sorting',
|
||||
LINK: '/algorithms/sorting',
|
||||
COMPONENT: SortingComponent
|
||||
};
|
||||
|
||||
static readonly GOL = {
|
||||
PATH: 'algorithms/gol',
|
||||
LINK: '/algorithms/gol',
|
||||
COMPONENT: ConwayGolComponent
|
||||
};
|
||||
|
||||
static readonly LABYRINTH = {
|
||||
PATH: 'algorithms/labyrinth',
|
||||
LINK: '/algorithms/labyrinth',
|
||||
COMPONENT: LabyrinthComponent
|
||||
};
|
||||
|
||||
static readonly FRACTAL = {
|
||||
PATH: 'algorithms/fractal',
|
||||
LINK: '/algorithms/fractal',
|
||||
COMPONENT: FractalComponent
|
||||
};
|
||||
|
||||
static readonly FRACTAL3d = {
|
||||
PATH: 'algorithms/fractal3d',
|
||||
LINK: '/algorithms/fractal3d',
|
||||
COMPONENT: Fractal3dComponent
|
||||
};
|
||||
|
||||
static readonly PENDULUM = {
|
||||
PATH: 'algorithms/pendulum',
|
||||
LINK: '/algorithms/pendulum',
|
||||
COMPONENT: PendulumComponent
|
||||
};
|
||||
|
||||
static readonly CLOTH = {
|
||||
PATH: 'algorithms/cloth',
|
||||
LINK: '/algorithms/cloth',
|
||||
COMPONENT: ClothComponent
|
||||
};
|
||||
|
||||
static readonly IMPRINT = {
|
||||
PATH: 'imprint',
|
||||
LINK: '/imprint',
|
||||
COMPONENT: ImprintComponent
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user