# Class ConfigService<Config>

#### Type Parameters

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

#### Implemented by

- ConfigTestingService

- Defined in config.service.ts:32

#####
Index

### Constructors

constructor

### Properties

config
Config
Defaults
LocalStorageKey
onError
onErrorFnc
onRequestError
onRequestErrorFnc
Overwrites
Urls

### Methods

clearLocalConfig
get
getOrThrow
setLocalConfig
Get
Load
SideLoad

##
Constructors

### constructor

- new ConfigService<Config extends Record<string, any> = Record<string, any>>(
  config?: any,
  ): ConfigService<Config>

  #### Type Parameters

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

  #### Parameters

  - config: any = null

  #### Returns ConfigService<Config>

  - Defined in config.service.ts:63

##
Properties

### `Readonly` config

config: Config

- Defined in config.service.ts:61

### `Static` Config

Config: any = null

- Defined in config.service.ts:40

### `Static` Defaults

Defaults: any = {}

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

- Defined in config.service.ts:47

### `Static` LocalStorageKey

LocalStorageKey: string = 'rxap/config/local-config'

- Defined in config.service.ts:55

### `Static` onError

onError: ReplaySubject<unknown> = ...

- Defined in config.service.ts:34

### `Static` onErrorFnc

onErrorFnc: (error: any) => void[] = []

- Defined in config.service.ts:37

### `Static` onRequestError

onRequestError: ReplaySubject<Response> = ...

- Defined in config.service.ts:35

### `Static` onRequestErrorFnc

onRequestErrorFnc: (response: Response) => void[] = []

- Defined in config.service.ts:38

### `Static` Overwrites

Overwrites: any = {}

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

- Defined in config.service.ts:53

### `Static` Urls

Urls: never[] = []

#### Deprecated

instead use the url property of the ConfigLoadOptions

- Defined in config.service.ts:60

##
Methods

### clearLocalConfig

- clearLocalConfig(): void

  #### Returns void

  - Defined in config.service.ts:346

### get

- get<T = any>(propertyPath: string): undefined | T

  #### Type Parameters

  - T = any

  #### Parameters

  - propertyPath: string

  #### Returns undefined | T

  - Defined in config.service.ts:350
- get<T = any>(propertyPath: string, defaultValue: NoInferType<T>): T

  #### Type Parameters

  - T = any

  #### Parameters

  - propertyPath: string
  - defaultValue: NoInferType<T>

  #### Returns T

  - Defined in config.service.ts:351

### getOrThrow

- getOrThrow<T = any>(propertyPath: string): T

  #### Type Parameters

  - T = any

  #### Parameters

  - propertyPath: string

  #### Returns T

  - Defined in config.service.ts:356
- getOrThrow<T = any>(propertyPath: string, defaultValue: NoInferType<T>): T

  #### Type Parameters

  - T = any

  #### Parameters

  - propertyPath: string
  - defaultValue: NoInferType<T>

  #### Returns T

  - Defined in config.service.ts:357

### setLocalConfig

- setLocalConfig(config: Config): void

  #### Parameters

  - config: Config

  #### Returns void

  - Defined in config.service.ts:342

### `Static` Get

- Get<T = any, K extends Record<string, any> = Record<string, any>>(
  path: string,
  defaultValue: undefined | T,
  config: Record<string, any>,
  ): T

  #### Type Parameters

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

  #### Parameters

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

  #### Returns T

  - Defined in config.service.ts:283

### `Static` Load

- Load(options?: ConfigLoadOptions, environment?: Environment): Promise<void>

  Used to load the app config from a remote resource.

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

  #### Parameters

  - `Optional` options: ConfigLoadOptions
  - `Optional` environment: Environment

  #### Returns Promise<void>

  - Defined in config.service.ts:81

### `Static` SideLoad

- SideLoad(
  url: string,
  propertyPath: string,
  required?: boolean,
  schema?: AnySchema,
  ): Promise<void>

  #### Parameters

  - url: string
  - propertyPath: string
  - `Optional` required: boolean
  - `Optional` schema: AnySchema

  #### Returns Promise<void>

  - Defined in config.service.ts:264