ProtectedaddRegister event listener with automatic binding and cleanup tracking
The eventbus to register with
Name of the event to listen for
Event handler function (will be bound to this controller)
Attach the controller and start observing mutations. Creates MutationObserver instance and begins monitoring the target element.
Eligius eventbus for broadcasting mutation events
ProtectedattachRegister multiple event listeners at once
The eventbus to register with
Array of {eventName, handler} pairs
Detach the controller and stop observing mutations. Disconnects MutationObserver and cleans up resources.
Eligius eventbus (used by BaseController for cleanup)
Initialize the controller with configuration metadata.
Configuration for observation behavior
Controller that observes DOM mutations on a selected element and broadcasts events.
This controller creates a MutationObserver to monitor DOM changes (attributes, child nodes, text content) on a specified element. All detected mutations are broadcasted through the Eligius eventbus, enabling reactive behavior in response to DOM changes.
The controller follows the standard Eligius lifecycle:
Example