Skip to main content

api.exec()

Description​

Allows triggering the inner events

The method is asynchronous and returns a Promise that resolves with the processed event config.

Usage​

api.exec(
event: string,
config: object
): Promise<any>;

Parameters​

  • event - (required) an event to be fired
  • config - (required) the config object with parameters (see the event to be fired)

Events​

info

The full list of the Booking internal events can be found here.

Example​

The example below demonstrates how to apply a filter at initialization:

const widget = new booking.Booking("#root", {
data,
//other configuration parameters
});
widget.api.exec("filter-data", {
text: "Allergist",
date: {
start: new Date,
end: new Date(2025, 2, 12)
},
time: [
{
from: 12,
to: 20
}
]
});