Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1.1 KiB

Angular: Global Features API

ConfigStateService.getGlobalFeatures API allows you to get the enabled features of the Global Features in the client side.

This document only explains the JavaScript API. See the Global Features document to understand the ABP Global Features system.

Usage


import { ConfigStateService } from '@abp/ng.core';

@Component({
  /* class metadata here */
})
class DemoComponent {
  constructor(private config: ConfigStateService) {}
}

// Gets all enabled global features.
const getGlobalFeatures = this.config.getGlobalFeatures ();

// { enabledFeatures: [ 'Shopping.Payment', 'Ecommerce.Subscription' ] }

// or
this.config.getGlobalFeatures$().subscribe(getGlobalFeatures => {
   // use getGlobalFeatures here
})

// Check the global feature is enabled
this.config.getGlobalFeatureIsEnabled('Ecommerce.Subscription')

true

> this.config.getGlobalFeatureIsEnabled('My.Subscription')

false

// or
this.config.getGlobalFeatureIsEnabled$('Ecommerce.Subscription').subscribe((isEnabled:boolean) => {
   // use isEnabled here
})