src/app/core/config/config.ts
The class which represents the config for the application.
Properties |
|
Methods |
constructor(id, configuration?: T)
|
|||||||||
Defined in src/app/core/config/config.ts:25
|
|||||||||
Parameters :
|
Static Readonly CONFIG_KEY |
Type : string
|
Default value : "CONFIG_ENTITY"
|
Defined in src/app/core/config/config.ts:15
|
The ID for the UI and data-model config |
data |
Type : T
|
Decorators :
@DatabaseField()
|
Defined in src/app/core/config/config.ts:25
|
This field contains all the configuration and does not have a predefined type. |
Static isInternalEntity |
Default value : true
|
Defined in src/app/core/config/config.ts:10
|
Static Readonly PERMISSION_KEY |
Type : string
|
Default value : "Permissions"
|
Defined in src/app/core/config/config.ts:20
|
The ID for the permission configuration |
copy |
copy()
|
Defined in src/app/core/config/config.ts:32
|
import { Entity } from "../entity/model/entity";
import { DatabaseField } from "../entity/database-field.decorator";
import { DatabaseEntity } from "../entity/database-entity.decorator";
/**
* The class which represents the config for the application.
*/
@DatabaseEntity("Config")
export class Config<T = any> extends Entity {
static override isInternalEntity = true;
/**
* The ID for the UI and data-model config
*/
static readonly CONFIG_KEY = "CONFIG_ENTITY";
/**
* The ID for the permission configuration
*/
static readonly PERMISSION_KEY = "Permissions";
/**
* This field contains all the configuration and does not have a predefined type.
*/
@DatabaseField() data: T;
constructor(id = Config.CONFIG_KEY, configuration?: T) {
super(id);
this.data = configuration;
}
override copy(): this {
const newConfig = super.copy();
newConfig.data = JSON.parse(JSON.stringify(this.data));
return newConfig;
}
}