src/lib/module-application.ts
Properties |
|
Methods |
|
constructor(environment: Environment, moduleType: Type
|
|||||||||||||||
Defined in src/lib/module-application.ts:18
|
|||||||||||||||
Parameters :
|
Public app |
Type : Ref | null
|
Default value : null
|
Inherited from
Application
|
Defined in
Application:35
|
Public config |
Type : ConfigService | null
|
Default value : null
|
Inherited from
Application
|
Defined in
Application:37
|
Public Readonly Optional configLoadOptions |
Type : ConfigLoadOptions
|
Inherited from
Application
|
Defined in
Application:44
|
Public Readonly environment |
Type : Environment
|
Inherited from
Application
|
Defined in
Application:42
|
Public logger |
Type : NGXLogger | null
|
Default value : null
|
Inherited from
Application
|
Defined in
Application:36
|
Public Readonly options |
Type : Config
|
Default value : {} as any
|
Inherited from
Application
|
Defined in
Application:43
|
Protected create |
create()
|
Inherited from
Application
|
Defined in
Application:29
|
Returns :
Promise<NgModuleRef<M>>
|
Protected prepareConfig | ||||||
prepareConfig(config: O)
|
||||||
Inherited from
Application
|
||||||
Defined in
Application:34
|
||||||
Parameters :
Returns :
void
|
Public after | ||||||
after(fnc: ApplicationAfterFunction<Ref>)
|
||||||
Inherited from
Application
|
||||||
Defined in
Application:86
|
||||||
Parameters :
Returns :
void
|
Public before | ||||||
before(fnc: ApplicationBeforeFunction<Config>)
|
||||||
Inherited from
Application
|
||||||
Defined in
Application:82
|
||||||
Parameters :
Returns :
void
|
Public Async bootstrap |
bootstrap()
|
Inherited from
Application
|
Defined in
Application:47
|
Returns :
any
|
Protected Async handleAfter | ||||||||||||
handleAfter(app: Ref, logger: NGXLogger, config: ConfigService)
|
||||||||||||
Inherited from
Application
|
||||||||||||
Defined in
Application:96
|
||||||||||||
Parameters :
Returns :
any
|
Protected Async handleBefore | |||||||||
handleBefore(config: ConfigService, options: Config)
|
|||||||||
Inherited from
Application
|
|||||||||
Defined in
Application:90
|
|||||||||
Parameters :
Returns :
any
|
Protected Async loadConfig | ||||||
loadConfig(environment: Environment)
|
||||||
Inherited from
Application
|
||||||
Defined in
Application:102
|
||||||
Parameters :
Returns :
any
|
Protected Async prepareEnvironment | ||||||
prepareEnvironment(environment: Environment)
|
||||||
Inherited from
Application
|
||||||
Defined in
Application:106
|
||||||
Parameters :
Returns :
any
|
import {
BootstrapOptions,
CompilerOptions,
NgModuleRef,
StaticProvider,
Type,
} from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { ConfigLoadOptions } from '@rxap/config';
import { Environment } from '@rxap/environment';
import { Application } from './application';
export interface ModuleApplicationConfig {
extraProviders?: StaticProvider[] | undefined;
compilerOptions?: (CompilerOptions & BootstrapOptions) | Array<CompilerOptions & BootstrapOptions>;
}
export class ModuleApplication<M, O extends ModuleApplicationConfig> extends Application<O, NgModuleRef<M>> {
constructor(
environment: Environment,
private readonly moduleType: Type<M>,
options?: O,
configLoadOptions?: ConfigLoadOptions,
) {
super(environment, options, configLoadOptions);
}
protected create(): Promise<NgModuleRef<M>> {
return platformBrowserDynamic(this.options.extraProviders)
.bootstrapModule(this.moduleType, this.options.compilerOptions);
}
protected override prepareConfig(config: O) {
config.extraProviders ??= [];
config.compilerOptions ??= [];
}
}