Open Closed

The attribute "setState" does not exist on the type "ConfigStateService"? #4652


User avatar
0
deathmid2233@gmail.com created

https://docs.abp.io/en/abp/latest/UI/Angular/Config-State-Service#set-state

Create an error/problem report:

  • ** ABPFrameVersion:** v7.0(latest)**
  • ** UIType**:Angular
  • Database provider:EF Core
  • Repeat the steps of the problem:“
import {AbpApplicationConfigurationService, ConfigStateService} from '@abp/ng.core';

constructor(private abpApplicationConfigurationService: AbpApplicationConfigurationService, private config: ConfigStateService) {
  this.abpApplicationConfigurationService.get().subscribe(config => {
    this.config.setState(config);
  })
}

3 Answer(s)
  • User Avatar
    0
    mahmut.gundogdu created

    The documanation is obsolate. It will be updated. If you want to update app state you can use this code

    configStateService.refreshAppState()
    

    https://github.com/abpframework/abp/blob/0c3e4c4ba3b2e0b9c3fe3031c53d79c255b97655/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts#L64

  • User Avatar
    0
    deathmid2233@gmail.com created

    The documanation is obsolate. It will be updated. If you want to update app state you can use this code

    configStateService.refreshAppState() 
    

    https://github.com/abpframework/abp/blob/0c3e4c4ba3b2e0b9c3fe3031c53d79c255b97655/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts#L64

    I want to set App status,like this:

    this.config.setState(newConfigObj);
    
  • User Avatar
    0
    mahmut.gundogdu created

    The documanation is obsolate. It will be updated.
    If you want to update app state you can use this code

    configStateService.refreshAppState()  
    

    https://github.com/abpframework/abp/blob/0c3e4c4ba3b2e0b9c3fe3031c53d79c255b97655/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts#L64

    I want to set App status,like this:

    this.config.setState(newConfigObj); 
    

    By default, you cannot manually update the Config state. But if you have to, ABP is open source. Copy the Config-StatService in your local, Change name of class Like MyConfigStateService then override via DI.

    so you can expose store objects as public or add new methods. also we are considered the changes. Maybe in the future, we will change. source code: https://github.com/abpframework/abp/blob/dev/npm/ng-packs/packages/core/src/lib/services/config-state.service.ts

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15