Abstract Private Static _componentInternal cache map storing component instances by their key/name to avoid recreating the same component multiple times during code generation
Abstract ConfigReturns the configuration type class used by this component generator. Each subclass should return their specific configuration class type.
The ComponentConfigBase subclass used for configuration
Abstract ImportReturns one or more AngularComponentInfo objects that represent the Angular classes used in the generated code. This information is used to generate proper import statements and module declarations.
Array of AngularComponentInfo objects
Abstract ImportReturns the NPM package import path for the Angular components used by this generator. Can be a local import path or an external package (e.g., '@memberjunction/ng-user-view-grid')
The import path string
Abstract GenerateGenerates the Angular template code for the related entity display component. This is the core method that each subclass must implement to create the appropriate Angular template based on the entity relationship and configuration.
Contains the entity, relationship info, and tab context needed for generation
Promise resolving to the generation result with template and optional code
Protected GetHelper method that returns the EntityFieldInfo object for the foreign key field in the specified entity that links to the related entity. Provides full field metadata.
The name of the entity containing the foreign key
The name of the entity being referenced
The EntityFieldInfo object for the foreign key field
Error if the entity or foreign key field cannot be found
Protected GetHelper method that returns the name of the foreign key field in the specified entity that links to the related entity. Useful for building relationship queries and joins.
The name of the entity containing the foreign key
The name of the entity being referenced
The name of the foreign key field
Error if the foreign key field cannot be found
Static GetFactory method that dynamically instantiates the correct RelatedEntityDisplayComponentGeneratorBase subclass based on the relationship configuration. Uses the MemberJunction class factory to resolve and create the appropriate component generator.
The relationship metadata containing display component configuration
User context for database interactions and permission checking
Rest ...params: any[]Additional parameters passed to the component constructor
Promise resolving to the appropriate component generator instance
Error if the specified display component cannot be found or instantiated
Abstract base class responsible for generating Angular template code for related entity display components. Each subclass handles a specific type of related entity display (e.g., UserViewGrid, JoinGrid, Timeline).
The generated templates are injected into Angular forms that extend BaseFormComponent, so all BaseFormComponent methods and properties are available in the generated templates:
Commonly used BaseFormComponent methods/properties:
BuildRelationshipViewParamsByEntityName()- Creates view parameters for related entitiesNewRecordValues()- Provides default values for new related recordsIsCurrentTab()- Checks if the current tab is active (useful for deferred loading)GridEditMode()- Determines if grids should be in edit modeGridBottomMargin()- Provides consistent bottom margin for gridsImplementation Pattern:
@RegisterClass(RelatedEntityDisplayComponentGeneratorBase, "YourComponentName")See
BaseFormComponent