Class ConfigService<Config>

Type Parameters

  • Config extends Record<string, any> = Record<string, any>

Implemented by

Constructors

Properties

config: Config
Config: any = null
Defaults: any = {}

Static default values for the config object. Will be overwritten by an dynamic config file specified in the Urls array.

LocalStorageKey: string = 'rxap/config/local-config'
onError: ReplaySubject<unknown> = ...
onErrorFnc: (error: any) => void[] = []
onRequestError: ReplaySubject<Response> = ...
onRequestErrorFnc: (response: Response) => void[] = []
Overwrites: any = {}

Any value definition in the Overwrites object will overwrite any value form the Defaults values or dynamic config files

Urls: never[] = []

instead use the url property of the ConfigLoadOptions

Methods

  • Type Parameters

    • T = any
    • K extends Record<string, any> = Record<string, any>

    Parameters

    • path: string
    • defaultValue: undefined | T
    • config: Record<string, any>

    Returns T

  • Used to load the app config from a remote resource.

    Promise.all([ ConfigService.Load() ]) .then(() => platformBrowserDynamic().bootstrapModule(AppModule)) .catch(err => console.error(err))

    Parameters

    Returns Promise<void>

  • Parameters

    • url: string
    • propertyPath: string
    • Optionalrequired: boolean
    • Optionalschema: AnySchema

    Returns Promise<void>