Home > widget-integration > CountdownTimerModule > onInitBlock

CountdownTimerModule.onInitBlock() method

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 document is an HTMLElement.

Signature:

protected onInitBlock(block: AppBlock): Promise<void>;

Parameters

Parameter

Type

Description

block

AppBlock

The TAE app block that triggered initialisation

Returns:

Promise<void>

Example

Override to inject custom data before connecting:

protected async onInitBlock(block: AppBlock): Promise<void> {
  block.document.dataset.shopTier = 'premium';
  return super.onInitBlock(block);
}