Home > widget-integration > CountdownTimerModule
CountdownTimerModule class
Module for the countdown timer widget.
Registers CountdownTimerAPI, CountdownTimerController, and as providers and listens for countdownTimer TAE blocks to bootstrap a controller per block instance.
Signature:
export declare class CountdownTimerModule
Example
Override to add analytics when a timer block initialises:
window.boostWidgetIntegration.extend('CountdownTimerModule', (CountdownTimerModule) => {
return class extends CountdownTimerModule {
async onInitBlock(block) {
this.trackTimerInit(block.id);
return super.onInitBlock(block);
}
};
});
Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Constructs a new instance of the |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
| |||
|
|
() => void |
Bound handler for the Arrow function to preserve | |
|
|
CountdownTimerController | null | ||
|
|
() => void |
Bound handler for the Arrow function to preserve | |
|
|
ModuleRefImpl |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
|
Destroy the active cart drawer countdown timer controller. Calls destroy() on the stored controller and nulls the reference. | |
|
|
Returns the cart drawer placeholder element for the countdown timer. Override to change the selector used to locate the timer container inside the cart drawer. | |
|
|
Returns the placement scope used when fetching the timer campaign for the cart drawer. | |
|
|
Initialise a countdown timer controller for the cart drawer. Destroys any existing cart drawer controller before creating a new one via DI. The resolved controller is stored in . | |
|
|
Initialises a CountdownTimerController for the given TAE block. Resolves a new controller instance via DI and connects it to the block's root element. Only processes blocks whose | |
|
|
Registers a TAE block listener that triggers for every Override to listen for additional block types or add pre-filtering logic. | |
|
|
Listens for cart drawer open/close events to manage the countdown timer lifecycle inside the cart drawer. On open: finds the |