Home > widget-integration > CountdownTimerModule > initCartDrawerTimer

CountdownTimerModule.initCartDrawerTimer() method

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 .

Signature:

protected initCartDrawerTimer(container: HTMLElement): Promise<void>;

Parameters

Parameter

Type

Description

container

HTMLElement

The placeholder element inside the cart drawer

Returns:

Promise<void>

Example

Override to pass additional data attributes before connecting:

protected async initCartDrawerTimer(container: HTMLElement) {
  container.dataset.shopId = this.appService.TAEAppConfig.shopId;
  return super.initCartDrawerTimer(container);
}