### File

`src/lib/module-application.ts`

### Extends

`Application`

### Index

###### Properties
Public app Public config Public Readonly Optional configLoadOptions Public Readonly environment Public logger Public Readonly options
###### Methods
Protected create Protected prepareConfig Public after Public before Public Async bootstrap Protected Async handleAfter Protected Async handleBefore Protected Async loadConfig Protected Async prepareEnvironment

### Constructor

`constructor(environment: Env, moduleType: Type, options?: O, configLoadOptions?: ConfigLoadOptions)`
Defined in src/lib/module-application.ts:18
Parameters :
Name | Type | Optional
environment | `Env` | No
moduleType | `Type<M>` | No
options | `O` | Yes
configLoadOptions | `ConfigLoadOptions` | Yes

### Properties

Public app
Type : `Ref | null`
Default value : `null`
Inherited from `Application`
Defined in `Application:39`

Public config
Type : `ConfigService | null`
Default value : `null`
Inherited from `Application`
Defined in `Application:41`

Public Readonly Optional configLoadOptions
Type : `ConfigLoadOptions`
Inherited from `Application`
Defined in `Application:48`

Public Readonly environment
Type : `Env`
Inherited from `Application`
Defined in `Application:46`

Public logger
Type : `Console | null`
Default value : `null`
Inherited from `Application`
Defined in `Application:40`

Public Readonly options
Type : `Config`
Default value : `{} as any`
Inherited from `Application`
Defined in `Application:47`

### Methods

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 :
Name | Type | Optional
config | `O` | No
Returns : `void`

Public after
`after(fnc: ApplicationAfterFunction<Config | Ref | Env>)`
Inherited from `Application`
Defined in `Application:90`
Parameters :
Name | Type | Optional
fnc | `ApplicationAfterFunction<Config | Ref | Env>` | No
Returns : `void`

Public before
`before(fnc: ApplicationBeforeFunction<Config | Ref | Env>)`
Inherited from `Application`
Defined in `Application:86`
Parameters :
Name | Type | Optional
fnc | `ApplicationBeforeFunction<Config | Ref | Env>` | No
Returns : `void`

Public Async bootstrap
`bootstrap()`
Inherited from `Application`
Defined in `Application:51`
Returns : `any`

Protected Async handleAfter
`handleAfter(app: Ref, logger: Console, config: ConfigService, options: Config, environment: Env)`
Inherited from `Application`
Defined in `Application:100`
Parameters :
Name | Type | Optional
app | `Ref` | No
logger | `Console` | No
config | `ConfigService` | No
options | `Config` | No
environment | `Env` | No
Returns : `any`

Protected Async handleBefore
`handleBefore(config: ConfigService, options: Config, environment: Env)`
Inherited from `Application`
Defined in `Application:94`
Parameters :
Name | Type | Optional
config | `ConfigService` | No
options | `Config` | No
environment | `Env` | No
Returns : `any`

Protected Async loadConfig
`loadConfig(environment: Env)`
Inherited from `Application`
Defined in `Application:106`
Parameters :
Name | Type | Optional
environment | `Env` | No
Returns : `any`

Protected Async prepareEnvironment
`prepareEnvironment(environment: Env)`
Inherited from `Application`
Defined in `Application:110`
Parameters :
Name | Type | Optional
environment | `Env` | No
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, Env extends Environment> extends Application<O, NgModuleRef<M>, Env> {

      constructor(
        environment: Env,
        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 ??= [];
      }

    }

# results matching ""

# No results matching ""