Browse Source

Commit message: Update ConfigStateService to include RefreshAppState method

pull/15925/head
Mahmut Gundogdu 3 years ago
parent
commit
2bbde091ba
  1. 14
      docs/en/UI/Angular/Config-State-Service.md

14
docs/en/UI/Angular/Config-State-Service.md

@ -113,19 +113,15 @@ this.config.getSetting$("Abp.Identity.TwoFactor.Behaviour").subscribe(twoFactorB
Please refer to `ApplicationConfigurationDto` type for all the properties you can get with `getOne` and `getDeep`. It can be found in the [models.ts file](https://github.com/abpframework/abp/blob/dev/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/models.ts#L11). Please refer to `ApplicationConfigurationDto` type for all the properties you can get with `getOne` and `getDeep`. It can be found in the [models.ts file](https://github.com/abpframework/abp/blob/dev/npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/models.ts#L11).
## Set State ## Refresh App State
`ConfigStateService` has a method named `setState` which allow you to set the state value. The `RefreshAppState` function is a method in the `ConfigStateService` service class that sends a request to a server to retrieve data and updates the internal state on the `ConfigStateService`. This function is responsible for refreshing the state of the service to reflect the latest configuration settings.
You can get the application configuration response and set the `ConfigStateService` state value as shown below:
```js ```js
import {ApplicationConfigurationService, ConfigStateService} from '@abp/ng.core'; import { ConfigStateService} from '@abp/ng.core';
constructor(private applicationConfigurationService: ApplicationConfigurationService, private config: ConfigStateService) { constructor( private configStateService: ConfigStateService) {
this.applicationConfigurationService.getConfiguration().subscribe(config => { this.configStateService.refreshAppState()
this.config.setState(config);
})
} }
``` ```

Loading…
Cancel
Save