src/lib/standalone-application.ts
Properties |
|
Methods |
|
constructor(environment: Env, 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: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
|
| 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<Config | Ref | Env>)
|
||||||
|
Inherited from
Application
|
||||||
|
Defined in
Application:90
|
||||||
|
Parameters :
Returns :
void
|
| Public before | ||||||
before(fnc: ApplicationBeforeFunction<Config | Ref | Env>)
|
||||||
|
Inherited from
Application
|
||||||
|
Defined in
Application:86
|
||||||
|
Parameters :
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 :
Returns :
any
|
| Protected Async handleBefore | ||||||||||||
handleBefore(config: ConfigService, options: Config, environment: Env)
|
||||||||||||
|
Inherited from
Application
|
||||||||||||
|
Defined in
Application:94
|
||||||||||||
|
Parameters :
Returns :
any
|
| Protected Async loadConfig | ||||||
loadConfig(environment: Env)
|
||||||
|
Inherited from
Application
|
||||||
|
Defined in
Application:106
|
||||||
|
Parameters :
Returns :
any
|
| Protected Async prepareEnvironment | ||||||
prepareEnvironment(environment: Env)
|
||||||
|
Inherited from
Application
|
||||||
|
Defined in
Application:110
|
||||||
|
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, Env extends Environment> extends Application<O, ApplicationRef, Env> {
constructor(
environment: Env,
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 ??= [];
}
}