src/lib/standalone-application.ts
Properties |
|
Methods |
|
constructor(environment: Environment, rootComponent: Type<>, options?: O, configLoadOptions: ConfigLoadOptions)
|
|||||||||||||||
Defined in src/lib/standalone-application.ts:13
|
|||||||||||||||
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:32
|
Returns :
Promise<ApplicationRef>
|
Public importProvidersFrom | ||||||
importProvidersFrom(...sources: ImportProvidersSource[])
|
||||||
Defined in src/lib/standalone-application.ts:27
|
||||||
Parameters :
Returns :
void
|
Protected prepareConfig | ||||||
prepareConfig(config: O)
|
||||||
Inherited from
Application
|
||||||
Defined in
Application:36
|
||||||
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 {
ApplicationConfig,
ApplicationRef,
importProvidersFrom,
ImportProvidersSource,
Type,
} from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
import { ConfigLoadOptions } from '@rxap/config';
import { Environment } from '@rxap/environment';
import { Application } from './application';
export class StandaloneApplication<O extends ApplicationConfig> extends Application<O, ApplicationRef> {
constructor(
environment: Environment,
private readonly rootComponent: Type<unknown>,
options?: O,
configLoadOptions: ConfigLoadOptions = {
url: `${ environment.origin ?? location.origin }/api/configuration/${ environment.tag ??
'latest' }/${ environment.app }`,
},
) {
super(environment, options, configLoadOptions);
}
public importProvidersFrom(...sources: ImportProvidersSource[]) {
this.options.providers ??= [];
this.options.providers.push(importProvidersFrom(...sources));
}
protected create(): Promise<ApplicationRef> {
return bootstrapApplication(this.rootComponent, this.options);
}
protected override prepareConfig(config: O) {
config.providers ??= [];
}
}