0.0.3 • Published 4 years ago

@weareatlas/atlas-config-angular v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Atlas Config Angular

The Atlas Config module contains services to support configuration injection when connecting to the Atlas cloud platform using Angular.

This project is part of the Atlas UI development suite.

Installation

Install the package with

npm install @weareatlas/atlas-config-angular --save
# or
yarn add @weareatlas/atlas-config-angular

Usage

Provide servers in the configuration for the environment

const config = {
    servers: {
        '(.*)': {
            oidc: {
               uri: '<oidcUrl>',
               clientId: '<clientId>',
               audience: '<audienceId>',
               scopes: '<scopes>',
               redirectUri: '<redirectUri>',
               logoutUri: '<logoutUri>',
            }
        }
    }
}

Add to the Angular module providers with

    providers: [
        {
            provide: APP_INITIALIZER,
            useFactory: (config: ConfigService) => () => config.load(config),
            deps: [ConfigService],
            multi: true
        }
    ]