[@rxap/config](../wiki/globals) / ConfigService

# Class: ConfigService\<Config\>

Defined in: [config.service.ts:32](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L32)

## Type Parameters

• **Config** *extends* `Record`\<`string`, `any`\> = `Record`\<`string`, `any`\>

## Constructors

### new ConfigService()

> **new ConfigService**\<`Config`\>(`config`): [`ConfigService`](../wiki/Class.ConfigService)\<`Config`\>

Defined in: [config.service.ts:63](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L63)

#### Parameters

##### config

`any` = `null`

#### Returns

[`ConfigService`](../wiki/Class.ConfigService)\<`Config`\>

## Properties

### config

> `readonly` **config**: `Config`

Defined in: [config.service.ts:61](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L61)

***

### Config

> `static` **Config**: `any` = `null`

Defined in: [config.service.ts:40](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L40)

***

### Defaults

> `static` **Defaults**: `any` = `{}`

Defined in: [config.service.ts:47](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L47)

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

***

### LocalStorageKey

> `static` **LocalStorageKey**: `string` = `'rxap/config/local-config'`

Defined in: [config.service.ts:55](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L55)

***

### onError

> `static` **onError**: `ReplaySubject`\<`unknown`\>

Defined in: [config.service.ts:34](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L34)

***

### onErrorFnc

> `static` **onErrorFnc**: (`error`) => `void`[] = `[]`

Defined in: [config.service.ts:37](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L37)

#### Parameters

##### error

`any`

#### Returns

`void`

***

### onRequestError

> `static` **onRequestError**: `ReplaySubject`\<`Response`\>

Defined in: [config.service.ts:35](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L35)

***

### onRequestErrorFnc

> `static` **onRequestErrorFnc**: (`response`) => `void`[] = `[]`

Defined in: [config.service.ts:38](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L38)

#### Parameters

##### response

`Response`

#### Returns

`void`

***

### Overwrites

> `static` **Overwrites**: `any` = `{}`

Defined in: [config.service.ts:53](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L53)

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

***

### ~~Urls~~

> `static` **Urls**: `never`[] = `[]`

Defined in: [config.service.ts:60](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L60)

#### Deprecated

instead use the url property of the ConfigLoadOptions

## Methods

### clearLocalConfig()

> **clearLocalConfig**(): `void`

Defined in: [config.service.ts:346](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L346)

#### Returns

`void`

***

### get()

#### Call Signature

> **get**\<`T`\>(`propertyPath`): `undefined` \| `T`

Defined in: [config.service.ts:350](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L350)

##### Type Parameters

• **T** = `any`

##### Parameters

###### propertyPath

`string`

##### Returns

`undefined` \| `T`

#### Call Signature

> **get**\<`T`\>(`propertyPath`, `defaultValue`): `T`

Defined in: [config.service.ts:351](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L351)

##### Type Parameters

• **T** = `any`

##### Parameters

###### propertyPath

`string`

###### defaultValue

[`NoInferType`](../wiki/TypeAlias.NoInferType)\<`T`\>

##### Returns

`T`

***

### getOrThrow()

#### Call Signature

> **getOrThrow**\<`T`\>(`propertyPath`): `T`

Defined in: [config.service.ts:356](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L356)

##### Type Parameters

• **T** = `any`

##### Parameters

###### propertyPath

`string`

##### Returns

`T`

#### Call Signature

> **getOrThrow**\<`T`\>(`propertyPath`, `defaultValue`): `T`

Defined in: [config.service.ts:357](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L357)

##### Type Parameters

• **T** = `any`

##### Parameters

###### propertyPath

`string`

###### defaultValue

[`NoInferType`](../wiki/TypeAlias.NoInferType)\<`T`\>

##### Returns

`T`

***

### setLocalConfig()

> **setLocalConfig**(`config`): `void`

Defined in: [config.service.ts:342](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L342)

#### Parameters

##### config

`Config`

#### Returns

`void`

***

### Get()

> `static` **Get**\<`T`, `K`\>(`path`, `defaultValue`, `config`): `T`

Defined in: [config.service.ts:283](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L283)

#### Type Parameters

• **T** = `any`

• **K** *extends* `Record`\<`string`, `any`\> = `Record`\<`string`, `any`\>

#### Parameters

##### path

`string`

##### defaultValue

`undefined` | `T`

##### config

`Record`\<`string`, `any`\>

#### Returns

`T`

***

### Load()

> `static` **Load**(`options`?, `environment`?): `Promise`\<`void`\>

Defined in: [config.service.ts:81](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L81)

Used to load the app config from a remote resource.

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

#### Parameters

##### options?

[`ConfigLoadOptions`](../wiki/Interface.ConfigLoadOptions)

##### environment?

`Environment`

#### Returns

`Promise`\<`void`\>

***

### SideLoad()

> `static` **SideLoad**(`url`, `propertyPath`, `required`?, `schema`?): `Promise`\<`void`\>

Defined in: [config.service.ts:264](https://gitlab.com/rxap/packages/-/blob/9978b20018f781a5952245bfe2db15ab7612611c/packages/angular/config/src/lib/config.service.ts#L264)

#### Parameters

##### url

`string`

##### propertyPath

`string`

##### required?

`boolean`

##### schema?

[`AnySchema`](../wiki/TypeAlias.AnySchema)

#### Returns

`Promise`\<`void`\>
