ElementRefToggleTriggerDirective
Defined in: directives/toggle/element-ref-toggle-trigger.directive.ts:18
Marks an element as a trigger for a toggle component using its ElementRef. Typically used to detect clicks or interactions on the element and notify the associated toggle to change state.
Remarks
Works as a lightweight directive to bind UI elements to toggle behavior.
Since
1.1.0
Author
Simon Kovtyk
Implements
AfterViewInitOnDestroy
Constructors
Constructor
new ElementRefToggleTriggerDirective(): ElementRefToggleTriggerDirective;Returns
ElementRefToggleTriggerDirective
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
trigger | readonly | Signal<ElementRef<HTMLElement>> | The required element that will act as the trigger for the toggle. | directives/toggle/element-ref-toggle-trigger.directive.ts:26 |
triggerEvent | readonly | Signal<string> | The event type that triggers the toggle (default is "click"). | directives/toggle/element-ref-toggle-trigger.directive.ts:29 |
Methods
ngAfterViewInit()
ngAfterViewInit(): void;Defined in: directives/toggle/element-ref-toggle-trigger.directive.ts:31
A callback method that is invoked immediately after Angular has completed initialization of a component's view. It is invoked only once when the view is instantiated.
Returns
void
Implementation of
AfterViewInit.ngAfterViewInitngOnDestroy()
ngOnDestroy(): void;Defined in: directives/toggle/element-ref-toggle-trigger.directive.ts:35
A callback method that performs custom clean-up, invoked immediately before a directive, pipe, or service instance is destroyed.
Returns
void
Implementation of
OnDestroy.ngOnDestroy