Skip to content

ConfigModule

Moe Myat Zaw edited this page Jun 15, 2020 · 8 revisions

The NGMODULE for providing ConfigService. Call configure method to provide options for ConfigService.

Module Class Overview

export class ConfigModule {
  /**
   * Call this method in root module to provide options for `ConfigService`.
   * @param loadOnStartUp If `true`, configuration values are loaded at app starts.
   *  Default value is `true`.
   * @param options Option object for `ConfigService`.
   */
  static configure(loadOnStartUp: boolean = true, options: ConfigOptions = {}): ModuleWithProviders<ConfigModule>;
}

Example

import { ConfigModule } from '@dagonmetric/ng-config';

@NgModule({
  imports: [
    // Other module imports

    // ng-config modules
    ConfigModule.configure(true, {
      debug: true
    })
  ]
})
export class AppModule { }

See ConfigModule source file to learn more about implementation.

Clone this wiki locally