Constructor
# protected new NgxBaseComponent(instance)
Initializes a new instance of the base component with the provided instance token. This constructor sets up the fundamental properties required by all Decaf components, including the component name, locale settings, and logging capabilities. The instance token is used for component identification and locale derivation.
The constructor performs the following initialization steps:
- Sets the componentName from the provided instance token
- Derives the componentLocale from the class name using utility functions
- Initializes the logger instance for the component
Creates an instance of NgxBaseComponent.
sequenceDiagram
participant A as Angular
participant C as Component
participant B as NgxBaseComponent
participant U as Utils
participant L as Logger
A->>C: new Component(instance)
C->>B: super(instance)
B->>B: Set componentName = instance
B->>U: getLocaleFromClassName(instance)
U-->>B: Return derived locale
B->>B: Set componentLocale
B->>L: getLogger(this)
L-->>B: Return logger instance
B->>B: Set logger
Parameters:
Name | Type | Description |
---|---|---|
instance |
string
|
The component instance token used for identification |