Member Junction
    Preparing search index...

    Base class for generating Angular client code for MemberJunction entities. This class handles the generation of Angular components, forms, and modules based on entity metadata. You can sub-class this class to create your own Angular client code generator logic.

    Index

    Constructors

    Properties

    subModule_BaseName: string = 'GeneratedForms_SubModule_'

    Base name used for generating sub-module names

    Accessors

    • get SubModuleBaseName(): string

      Get the base name for the sub-modules. Override this method to change the base name.

      Returns string

      The base name for sub-modules (default: 'GeneratedForms_SubModule_')

    Methods

    • Converts a string to camelCase and sanitizes it for use as a JavaScript identifier

      Parameters

      • str: string

        The string to convert

      Returns string

      String in camelCase format, safe for use as object key or variable name

    • Removes orphaned Angular entity form directories that no longer correspond to existing entities. This handles cleanup when entities are renamed or deleted.

      Parameters

      • entityPath: string

        The path to the Entities directory containing entity form subdirectories

      • entities: EntityInfo[]

        Array of current EntityInfo objects that should have form directories

      Returns void

    • Main entry point for generating Angular code for a collection of entities

      Parameters

      • entities: EntityInfo[]

        Array of EntityInfo objects to generate Angular code for

      • directory: string

        The output directory where generated files will be saved

      • modulePrefix: string

        A prefix to use for the generated module name

      • contextUser: UserInfo

        The user context for permission checking and personalization

      Returns Promise<boolean>

      Promise True if generation was successful, false otherwise

    • Generates the main Angular module that imports all generated components and sub-modules

      Parameters

      • componentImports: string[]

        Array of import statements for generated components

      • componentNames: {
            componentName: string;
            relatedEntityItemsRequired: {
                itemClassName: string;
                moduleClassName: string;
            }[];
        }[]

        Array of component names with their required related entity items

      • relatedEntityModuleImports: { library: string; modules: string[] }[]

        Array of library imports for related entity modules

      • sections: AngularFormSectionInfo[]

        Array of form section information

      • modulePrefix: string

        Prefix for the module name

      • maxComponentsPerModule: number = 25

        Maximum number of components to include in each sub-module (default: 25)

      Returns string

      The generated TypeScript code for the Angular module

    • Generates sub-modules to handle large numbers of components by breaking them into smaller chunks

      Parameters

      • componentNames: {
            componentName: string;
            relatedEntityItemsRequired: {
                itemClassName: string;
                moduleClassName: string;
            }[];
        }[]

        Array of component names with their required related entity items

      • sections: AngularFormSectionInfo[]

        Array of form section information

      • maxComponentsPerModule: number

        Maximum components per sub-module

      • modulePrefix: string

        Prefix for module naming

      Returns string

      Generated TypeScript code for all sub-modules and the master module

    • Generates organic key tab sections for an entity form. Organic keys enable cross-entity relationships based on shared business data (email, phone, etc.). Each organic key related entity gets its own collapsible panel with an EntityDataGrid.

      Parameters

      • entity: EntityInfo

        The entity to generate organic key tabs for

      • startIndex: number

        Starting index for tab ordering

      Returns AngularFormSectionInfo[]

      Array of organic key tab sections

    • Generates the closing section of a sub-module including imports and exports

      Parameters

      • moduleNumber: number

        The sequential number of this sub-module

      • additionalModulesToImport: string[]

        Array of additional module names to import

      Returns string

      TypeScript code for the sub-module ending

    • Generates HTML for the top area section of an entity form

      Parameters

      • entity: EntityInfo

        The entity to generate top area HTML for

      Returns string

      HTML string for the top area section, or empty string if no top area exists

    • Maps category names to appropriate Font Awesome icon classes

      Parameters

      • category: string

        The category name to map

      Returns string

      Font Awesome icon class string

    • Generates the inner HTML for the top area section

      Parameters

      • topArea: string

        The top area content

      Returns string

      HTML string for the top area container, or empty string if no content

    • Checks whether a virtual field is the name-field-map target of an FK field on the same entity. For example, if entity has ParentID (FK) with RelatedEntityNameFieldMap = 'Parent', then the virtual Parent field is redundant on the form since the FK field will display the name at runtime.

      Parameters

      Returns boolean

    • Converts a string to PascalCase and sanitizes it for use as a class name

      Parameters

      • str: string

        The string to convert

      Returns string

      String in PascalCase format, safe for use as a class name

    • Recursively removes a directory and all its contents (files and subdirectories).

      Parameters

      • dirPath: string

        The path to the directory to remove

      Returns void

    • Sanitizes a string to create a valid filename in lowercase format. Removes all non-alphanumeric characters (except spaces) and converts to lowercase. Used for creating component filenames that are safe across all file systems.

      Example: "Timeline & Budget" → "timelinebudget"

      Parameters

      • str: string

        The string to sanitize

      Returns string

      A sanitized lowercase filename string