From 03d71d787558b38084873f6152cbd69174479b5f Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 17 Jun 2020 19:22:20 +0300 Subject: [PATCH] feat: add forChild and forLazy static methods --- .../src/lib/tenant-management.module.ts | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts b/npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts index 046a2b9842..035b658363 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts +++ b/npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts @@ -1,13 +1,13 @@ -import { CoreModule } from '@abp/ng.core'; +import { CoreModule, LazyModuleFactory } from '@abp/ng.core'; +import { FeatureManagementModule } from '@abp/ng.feature-management'; import { ThemeSharedModule } from '@abp/ng.theme.shared'; -import { NgModule, Provider } from '@angular/core'; +import { ModuleWithProviders, NgModule, NgModuleFactory } from '@angular/core'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgxValidateCoreModule } from '@ngx-validate/core'; import { NgxsModule } from '@ngxs/store'; import { TenantsComponent } from './components/tenants/tenants.component'; import { TenantManagementState } from './states/tenant-management.state'; import { TenantManagementRoutingModule } from './tenant-management-routing.module'; -import { FeatureManagementModule } from '@abp/ng.feature-management'; -import { NgxValidateCoreModule } from '@ngx-validate/core'; @NgModule({ declarations: [TenantsComponent], @@ -22,4 +22,15 @@ import { NgxValidateCoreModule } from '@ngx-validate/core'; FeatureManagementModule, ], }) -export class TenantManagementModule {} +export class TenantManagementModule { + static forChild(): ModuleWithProviders { + return { + ngModule: TenantManagementModule, + providers: [], + }; + } + + static forLazy(): NgModuleFactory { + return new LazyModuleFactory(TenantManagementModule.forChild()); + } +}