mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-12 05:43:03 -05:00
feat(challengestandalone): challenge standalone
This commit is contained in:
1
libs/module-to-standalone/shell/src/index.ts
Normal file
1
libs/module-to-standalone/shell/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './lib/main-shell.module';
|
||||
11
libs/module-to-standalone/shell/src/lib/main-shell.module.ts
Normal file
11
libs/module-to-standalone/shell/src/lib/main-shell.module.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { provideToken } from '@angular-challenges/module-to-standalone/core/providers';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { appRoutes } from './main-shell.routes';
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(appRoutes)],
|
||||
exports: [RouterModule],
|
||||
providers: [provideToken('main-shell-token')],
|
||||
})
|
||||
export class MainShellModule {}
|
||||
34
libs/module-to-standalone/shell/src/lib/main-shell.routes.ts
Normal file
34
libs/module-to-standalone/shell/src/lib/main-shell.routes.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Route } from '@angular/router';
|
||||
|
||||
export const appRoutes: Route[] = [
|
||||
{ path: '', redirectTo: 'home', pathMatch: 'full' },
|
||||
{
|
||||
path: 'home',
|
||||
loadChildren: () =>
|
||||
import('@angular-challenges/module-to-standalone/home').then(
|
||||
(m) => m.ModuleToStandaloneHomeModule
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'admin',
|
||||
loadChildren: () =>
|
||||
import('@angular-challenges/module-to-standalone/admin/feature').then(
|
||||
(m) => m.AdminFeatureModule
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'user',
|
||||
loadChildren: () =>
|
||||
import('@angular-challenges/module-to-standalone/user/shell').then(
|
||||
(m) => m.UserShellModule
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
path: 'forbidden',
|
||||
loadChildren: () =>
|
||||
import('@angular-challenges/module-to-standalone/forbidden').then(
|
||||
(m) => m.ForbiddenModule
|
||||
),
|
||||
},
|
||||
];
|
||||
8
libs/module-to-standalone/shell/src/test-setup.ts
Normal file
8
libs/module-to-standalone/shell/src/test-setup.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
|
||||
globalThis.ngJest = {
|
||||
testEnvironmentOptions: {
|
||||
errorOnUnknownElements: true,
|
||||
errorOnUnknownProperties: true,
|
||||
},
|
||||
};
|
||||
import 'jest-preset-angular/setup-jest';
|
||||
Reference in New Issue
Block a user