Members
Array.<MenuItem>
# constant Menu
This constant defines the structure of the application's navigation menu. It includes items for the dashboard, CRUD operations, data lists, and logout.
Menu items for the application's navigation
Example
const menuItem = Menu[0];
console.log(menuItem.label); // 'Dashboard'
console.log(menuItem.url); // '/dashboard'
Methods
# Dynamic() → {function}
Decorator that registers an Angular component with the NgxRenderingEngine for dynamic loading. This decorator must be applied before the @Component decorator to properly extract component metadata. It adds metadata to the component class and registers it with the rendering engine using its selector.
Marks an Angular component as dynamically loadable
A decorator function that can be applied to Angular component classes
function
# createDbAdapter()
Factory function to create and configure the database adapter Sets the adapter name on the window object for global access
.Factory function to create and configure the database adapter Sets the adapter name on the window object for global access
# dataMapper(data, mapper, propsopt) → {Array.<T>}
Maps an array of data objects using a provided mapper object.
Maps an array of data objects using a provided mapper object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Array.<any>
|
The array of data objects to be mapped. |
|
mapper |
KeyValue
|
An object that defines the mapping rules. |
|
props |
KeyValue
|
<optional> |
Additional properties to be included in the mapped items. |
- The array of mapped items. If an item in the original array does not have any non-null values after mapping, the original item is returned instead.
Array.<T>
# async execute(command)
Executes a shell command asynchronously.
Executes a shell command asynchronously.
Parameters:
Name | Type | Description |
---|---|---|
command |
The shell command to execute. |
A Promise that resolves with the command's stdout output as a string if successful, or rejects with an error message if the command fails or produces stderr output.
# formatDate(date, localeopt) → {Date|string}
Formats a date into a localized string representation
.Formats a date into a localized string representation
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
date |
string
|
Date
|
number
|
The date to format. Can be a Date object, a timestamp number, or a date string |
|
locale |
string
|
<optional> |
The locale to use for formatting. If not provided, the system's locale will be used |
A formatted date string in the format DD/MM/YYYY according to the specified locale, or the original input as a string if the date is invalid
Date
|
string
# isValidDate(date) → {boolean}
Checks if a value is a valid Date object
.Checks if a value is a valid Date object
Parameters:
Name | Type | Description |
---|---|---|
date |
string
|
Date
|
number
|
The value to check. Can be a Date object, a timestamp number, or a date string |
Returns true if the value is a valid Date object (not NaN), otherwise false
boolean
# itemMapper(item, mapper, propsopt) → {KeyValue}
Maps an item object using a provided mapper object and optional additional properties.
Maps an item object using a provided mapper object and optional additional properties.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
item |
KeyValue
|
The source object to be mapped. |
|
mapper |
KeyValue
|
An object that defines the mapping rules. Keys represent the new property names, and values represent the path to the corresponding values in the source object. |
|
props |
KeyValue
|
<optional> |
Optional additional properties to be included in the mapped object. |
A new object with properties mapped according to the mapper object and including any additional properties.
KeyValue
# parseProjectName(value)
Parses and normalizes the project name input.
Parses and normalizes the project name input.
Parameters:
Name | Type | Description |
---|---|---|
value |
The input project name to be parsed. Can be 'app', 'lib', or any other string value. |
A normalized string representation of the project name. Returns 'for-angular-app' if input is 'app', 'for-angular' if input is 'lib', or the lowercase version of the input for any other value.
# parseToValidDate(date) → {Date|null}
Attempts to parse a date string, Date object, or number into a valid Date object
.Attempts to parse a date string, Date object, or number into a valid Date object
Parameters:
Name | Type | Description |
---|---|---|
date |
string
|
Date
|
number
|
The date to parse. Can be a Date object, a timestamp number, or a date string in the format "DD/MM/YYYY HH:MM:SS:MS" |
A valid Date object if parsing is successful, or null if the date is invalid or doesn't match the expected format
Date
|
null
# resolveValidatorKeyProps(key, value, type)
Resolves the correct validator key and its associated properties based on the input key and type.
Resolves the correct validator key and its associated properties based on the input key and type.
When the validation key is TYPE, it's necessary to resolve the actual validator based on the field's type (e.g., 'password', 'email', 'url') instead of using the generic getValidator("type") logic. This allows directly invoking specific validators like getValidator('password'), ensuring the correct behavior for type-based validation.
Parameters:
Name | Type | Description |
---|---|---|
key |
The validation key (e.g., 'type', 'required', etc.). |
|
value |
The value that needs be provided to the validator. |
|
type |
The field's declared type. |
An object containing the resolved validator key and its corresponding props.
# stringToBoolean(prop) → {boolean}
Converts a string representation of a boolean or a boolean value to a boolean type.
Converts a string representation of a boolean or a boolean value to a boolean type.
Parameters:
Name | Type | Description |
---|---|---|
prop |
'true'
|
'false'
|
boolean
|
The value to convert. Can be the string 'true', 'false', or a boolean. |
The boolean representation of the input value. Returns true if the input is the string 'true' or boolean true, false otherwise.
boolean
# validateProject(value)
Validates if the given project value is a valid enum member of Projects.
Validates if the given project value is a valid enum member of Projects.
Parameters:
Name | Type | Description |
---|---|---|
value |
The project value to validate. |
A boolean indicating whether the value is a valid Projects enum member.
# validateType(value)
Validates if the given type value is a valid enum member of Types.
Validates if the given type value is a valid enum member of Types.
Parameters:
Name | Type | Description |
---|---|---|
value |
The type value to validate. |
A boolean indicating whether the value is a valid Types enum member.