Class

DecafTooltipDirective

DecafTooltipDirective~DecafTooltipDirective()

Constructor

# new DecafTooltipDirective()

The DecafTooltipDirective is a standalone Angular directive bound to the [ngx-decaf-tooltip] attribute selector. It processes the TooltipConfig provided via the options input, sanitizes the text, and appends a .dcf-tooltip <span> containing the sanitized full text to the host element. The directive also applies the dcf-tooltip-parent CSS class to the host for tooltip positioning. When truncation is enabled, the host element's inner content is replaced with the truncated text before the tooltip span is added.

Angular directive that appends a tooltip <span> to the host element and optionally truncates its visible text content.

View Source lib/directives/tooltip.directive.ts, line 17

Example
```html
<!-- Basic tooltip -->
<span [ngx-decaf-tooltip]="{ text: 'Full description here' }">Hover me</span>

<!-- Truncated visible text with tooltip showing the full content -->
<span [ngx-decaf-tooltip]="{ text: veryLongLabel, truncate: true, limit: 20, trail: '…' }">
  {{ veryLongLabel }}
</span>
```

Methods

# ngOnChanges() → {void}

Processes the TooltipConfig options, sanitizes the text, and updates the host element's content and tooltip span accordingly. Applies the dcf-tooltip-parent CSS class to the host for styling.

Angular lifecycle hook invoked whenever one or more input properties change.

View Source lib/directives/tooltip.directive.ts, line 127

void

DecafTooltipDirective~DecafTooltipDirective() → {void}

Constructor

# new DecafTooltipDirective() → {void}

Processes the ITooltipConfig options, sanitizes the text, and updates the host element's content and tooltip span accordingly. Applies the dcf-tooltip-parent CSS class to the host for styling.

Angular lifecycle hook invoked whenever one or more input properties change.

View Source lib/directives/tooltip.directive.ts, line 45

void

Methods

# ngOnChanges() → {void}

Processes the TooltipConfig options, sanitizes the text, and updates the host element's content and tooltip span accordingly. Applies the dcf-tooltip-parent CSS class to the host for styling.

Angular lifecycle hook invoked whenever one or more input properties change.

View Source lib/directives/tooltip.directive.ts, line 127

void