### 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: Environment, moduleType: Type<M>, options?: O, configLoadOptions?: ConfigLoadOptions)`
Defined in src/lib/module-application.ts:18

Parameters :

Name | Type | Optional
environment | `Environment` | 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: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`

### 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<Ref>)`
Inherited from `Application`
Defined in `Application:86`

Parameters :

Name | Type | Optional
fnc | `ApplicationAfterFunction<Ref>` | No

Returns : `void`

Public before
`before(fnc: ApplicationBeforeFunction<Config>)`
Inherited from `Application`
Defined in `Application:82`

Parameters :

Name | Type | Optional
fnc | `ApplicationBeforeFunction<Config>` | No

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 :

Name | Type | Optional
app | `Ref` | No
logger | `NGXLogger` | No
config | `ConfigService` | No

Returns : `any`

Protected Async handleBefore
`handleBefore(config: ConfigService, options: Config)`
Inherited from `Application`
Defined in `Application:90`

Parameters :

Name | Type | Optional
config | `ConfigService` | No
options | `Config` | No

Returns : `any`

Protected Async loadConfig
`loadConfig(environment: Environment)`
Inherited from `Application`
Defined in `Application:102`

Parameters :

Name | Type | Optional
environment | `Environment` | No

Returns : `any`

Protected Async prepareEnvironment
`prepareEnvironment(environment: Environment)`
Inherited from `Application`
Defined in `Application:106`

Parameters :

Name | Type | Optional
environment | `Environment` | 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> 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 ??= [];
      }

    }

# results matching ""

# No results matching ""