Entity Configuration

The provided configuration defines the structure for customizing the entity settings in your application. You can use the LibConfig interface and LIB_ENTITY_CONFIG injection token to set up and manage these configurations globally.

Your config will be similar to this object :

app.config.ts
import { LIB_UTILITIES_CONFIG } from '@tradinos/cms-frontend-utilities';
import { LIB_ENTITY_CONFIG } from '@tradinos/cms-frontend-entity';

{
  provide: LIB_UTILITIES_CONFIG,
  useValue: {
    // Base URL for the server API. Used to define the root path for all backend requests.
    SERVER_API_URL: environment.SERVER_BASE_URL,
  },
 },
{
  provide: LIB_ENTITY_CONFIG,
  useValue: {
    //Available page size options for pagination, allowing you to select the number of items per page.
    CMS_PAGE_SIZES: environment.CMS_PAGE_SIZES,
    //Default page size to be used when displaying paginated content..
    CMS_PAGE_SIZE: environment.PAGE_SIZE,
    // Configuration settings for modal dialogs
    DIALOG_CONFIGURATION: environment.DIALOG_CONFIGURATION,
    // The default query parameter name for sorting data
    CMS_SORT_NAME: environment.CMS_SORT_NAME,
    // The default query parameter name for defining sort direction (e.g., 'asc' or 'desc').
    CMS_DIR_NAME: environment.CMS_DIR_NAME,
  },
}

To configure your application further, you need to define a configuration object. Start by specifying the necessary properties like DIALOG_CONFIGURATION, CMS_PAGE_SIZE, and CMS_API_URL within this object, using values from your environment. You should also provide CMS_PAGE_SIZES for different display options. Integrate this configuration using the useValue attribute combined with provide.

You can add your configuration directly or you can add it in external file :

In the following sections, we will explore modifying these settings to tailor the appearance and functionality of your application.

Last updated