api.exec()
Description
Allows triggering inner events
Usage
api.exec(
event: string,
config: object
): void;
Parameters
event
- (required) an event to be firedconfig
- (required) the config object with parameters (see the event to be fired)
Events
info
The full list of RichText internal events can be found here
Example
// initialize RichText
const editor = new richtext.Richtext("#root", {
// configuration properties
});
// set the text font size
editor.api.exec("set-font-size", {
fontSize: "16px"
});
Change log: The method was added in v2.0