Documentation
Fuse Components
Services

## Config

FuseConfigService is a singleton service to store and access an application wide configuration object. It can be used to store any kind of data and can be accessed from anywhere within your application.

## Module

import { FuseConfigModule } from '@fuse/services/config';

## Default configuration

By default, the application wide configuration is stored in `src/app.config.ts` file and it includes the layout style as well as the color theme configurations:

provideFuse({ ... fuse : { layout : 'classy', scheme : 'light', screens: { sm: '600px', md: '960px', lg: '1280px', xl: '1440px', }, theme : 'theme-default', themes : [{ id : 'theme-default', name: 'Default', }, { id : 'theme-brand', name: 'Brand', }, { id : 'theme-teal', name: 'Teal', }, { id : 'theme-rose', name: 'Rose', }, { id : 'theme-purple', name: 'Purple', }, { id : 'theme-amber', name: 'Amber', }], }, }),

The default configuration is supplied to the FuseConfigService automatically:

## Methods

To set a configuration use `config` setter on FuseConfigService. The setter will intelligently merge the configuration by replacing only the given options if they exist while preserving others. If the supplied option does not exist on the configuration, it will be added:

import { FuseConfigService } from '@fuse/services/config'; private _fuseConfigService = inject(FuseConfigService); /** * Constructor */ constructor() { this._fuseConfigService.config = {layout: 'classy'}; }

To get the configuration use `config$` getter on FuseConfigService which returns an `Observable` of the configuration object:

import { FuseConfigService } from '@fuse/services/config'; import { AppConfig } from 'app/core/config/app.config'; private _fuseConfigService = inject(FuseConfigService); config: AppConfig; /** * Constructor */ constructor() { this._fuseConfigService.config$ .pipe(takeUntil(this._unsubscribeAll)) .subscribe((config: AppConfig) => { this.config = config; } });