mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 06:13:03 -05:00
feat(challengestandalone): challenge standalone
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { IsAuthorizedGuard } from '@angular-challenges/module-to-standalone/admin/shared';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
@NgModule({
|
||||
declarations: [],
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule.forChild([
|
||||
{
|
||||
path: '',
|
||||
canActivate: [IsAuthorizedGuard],
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () =>
|
||||
import('./dashboard/dashboard.component').then(
|
||||
(m) => m.DashboardModule
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'create-user',
|
||||
loadChildren: () =>
|
||||
import('./create-user/create-user.component').then(
|
||||
(m) => m.CreateUserModule
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
]),
|
||||
],
|
||||
})
|
||||
export class AdminFeatureModule {}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'lib-create-user',
|
||||
template: `Create User Form
|
||||
|
||||
<button
|
||||
routerLink=".."
|
||||
class="border bg-gray-700 rounded-lg p-2 text-white ml-5">
|
||||
Back
|
||||
</button> `,
|
||||
})
|
||||
export class CreateUserComponent {}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([{ path: '', component: CreateUserComponent }]),
|
||||
],
|
||||
declarations: [CreateUserComponent],
|
||||
})
|
||||
export class CreateUserModule {}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'lib-dashboard',
|
||||
template: `Dashboard
|
||||
|
||||
<button
|
||||
routerLink="create-user"
|
||||
class="border bg-gray-700 rounded-lg p-2 text-white ml-10">
|
||||
Create User
|
||||
</button> `,
|
||||
})
|
||||
export class DashboardComponent {}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([{ path: '', component: DashboardComponent }]),
|
||||
],
|
||||
declarations: [DashboardComponent],
|
||||
})
|
||||
export class DashboardModule {}
|
||||
Reference in New Issue
Block a user