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.

Constructors

Properties

subModule_BaseName: string = 'GeneratedForms_SubModule_'

Base name used for generating sub-module names

Accessors

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

  • 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 the tab name for a related entity tab. Appends the field's display name to the tab name if there are multiple tabs for the same related entity to differentiate them.

    Parameters

    Returns string

    The generated tab name

  • Generates HTML without a splitter layout for entities without a top area

    Parameters

    • topArea: string

      HTML for the top area section (expected to be empty)

    • additionalSections: AngularFormSectionInfo[]

      Array of additional form sections

    • relatedEntitySections: AngularFormSectionInfo[]

      Array of related entity sections

    Returns string

    Generated HTML without splitter layout

  • Generates HTML with a vertical splitter layout for entities with a top area

    Parameters

    Returns string

    Generated HTML with splitter layout

  • 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

  • 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

  • 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

  • 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