|
|
|
@ -11,9 +11,9 @@ import { ManageProfileComponent } from './components/manage-profile/manage-profi
|
|
|
|
|
import { PersonalSettingsComponent } from './components/personal-settings/personal-settings.component';
|
|
|
|
|
import { RegisterComponent } from './components/register/register.component';
|
|
|
|
|
import { TenantBoxComponent } from './components/tenant-box/tenant-box.component';
|
|
|
|
|
import { Options } from './models/options';
|
|
|
|
|
import { ACCOUNT_OPTIONS } from './tokens/options.token';
|
|
|
|
|
import { accountOptionsFactory } from './utils/factory-utils';
|
|
|
|
|
import { AccountConfigOptions } from './models/config-options';
|
|
|
|
|
import { ACCOUNT_CONFIG_OPTIONS } from './tokens/config-options.token';
|
|
|
|
|
import { accountConfigOptionsFactory } from './utils/factory-utils';
|
|
|
|
|
import { AuthenticationFlowGuard } from './guards/authentication-flow.guard';
|
|
|
|
|
import { AuthenticationService } from './services/authentication.service';
|
|
|
|
|
import { ForgotPasswordComponent } from './components/forgot-password/forgot-password.component';
|
|
|
|
@ -43,23 +43,23 @@ const declarations = [
|
|
|
|
|
exports: [...declarations],
|
|
|
|
|
})
|
|
|
|
|
export class AccountModule {
|
|
|
|
|
static forChild(options = {} as Options): ModuleWithProviders<AccountModule> {
|
|
|
|
|
static forChild(options = {} as AccountConfigOptions): ModuleWithProviders<AccountModule> {
|
|
|
|
|
return {
|
|
|
|
|
ngModule: AccountModule,
|
|
|
|
|
providers: [
|
|
|
|
|
AuthenticationFlowGuard,
|
|
|
|
|
AuthenticationService,
|
|
|
|
|
{ provide: ACCOUNT_OPTIONS, useValue: options },
|
|
|
|
|
{ provide: ACCOUNT_CONFIG_OPTIONS, useValue: options },
|
|
|
|
|
{
|
|
|
|
|
provide: 'ACCOUNT_OPTIONS',
|
|
|
|
|
useFactory: accountOptionsFactory,
|
|
|
|
|
deps: [ACCOUNT_OPTIONS],
|
|
|
|
|
useFactory: accountConfigOptionsFactory,
|
|
|
|
|
deps: [ACCOUNT_CONFIG_OPTIONS],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static forLazy(options = {} as Options): NgModuleFactory<AccountModule> {
|
|
|
|
|
static forLazy(options = {} as AccountConfigOptions): NgModuleFactory<AccountModule> {
|
|
|
|
|
return new LazyModuleFactory(AccountModule.forChild(options));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|