# bdt105angularconfigurationservice

> Configuration

Latest version **2.0.9** (published 2018-11-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install bdt105angularconfigurationservice
pnpm add bdt105angularconfigurationservice
yarn add bdt105angularconfigurationservice
bun add bdt105angularconfigurationservice
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.9 |
| Published | 2018-11-01 |
| First published | 2018-03-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 19.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | bdt105 |
| Maintainers | bdt105 |
| Keywords | vidal |

## Links

- npm: https://www.npmjs.com/package/bdt105angularconfigurationservice
- Repository: https://github.com/bdt105/modules
- Homepage: https://github.com/bdt105/modules#readme
- Issues: https://github.com/bdt105/modules/issues
- npm.io page: https://npm.io/package/bdt105angularconfigurationservice

## Dependencies (1)

- [bdt105toolbox](https://npm.io/package/bdt105toolbox.md) 2.0.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.9 (latest) — 2018-11-01
- 2.0.8 — 2018-08-07
- 2.0.7 — 2018-05-18
- 2.0.6 — 2018-05-18
- 2.0.5 — 2018-05-18
- 2.0.4 — 2018-05-18
- 2.0.3 — 2018-05-18
- 2.0.2 — 2018-05-18
- 2.0.1 — 2018-05-18
- 2.0.0 — 2018-05-05
- 1.0.9 — 2018-05-05
- 1.0.8 — 2018-05-05
- 1.0.7 — 2018-05-05
- 1.0.6 — 2018-05-05
- 1.0.5 — 2018-05-05
- … 4 more at https://npm.io/package/bdt105angularconfigurationservice/versions

## README

# Angular Configuration Service

## Principle
Allows to read a configuration file before the angular app starts

## Dependencies
bdt105toolbox (https://github.com/bdt105/modules/tree/master/toolbox)

## Installation
In your app.module.ts insert


``` 
import { ConfigurationService } from 'bdt105angularconfigurationservice';
import { NgModule, APP_INITIALIZER } from '@angular/core';

...

export function init (config: ConfigurationService) {
    config.load();
    return () => {
        return config.load(); // add return
    };
}

@NgModule({
    declarations: [
        ],
    imports: [
        ],
    providers: [
        {
            'provide': APP_INITIALIZER,
            'useFactory': init,
            'deps': [ ConfigurationService ],
            'multi': true
        },
        ConfigurationService
        ],
    bootstrap: [AppComponent]    
});

...

providers: [ ConfigurationService ];

```

Into your component

``` 
import { ConfigurationService } from 'bdt105angularconfigurationservice';

...

constructor(private configurationService: ConfigurationService) {}

public getConfigurationBackgroungColor(){
    let conf = this.configurationService.get();
    return conf.backgroundColor;
}
```

---
_Source: https://npm.io/package/bdt105angularconfigurationservice · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
