Handlers

In order to control behavior of prop and display on layout, you can use handlers. With handlers, you can change default behavior of props.

All handlers are written as async Angular modules, meaning they are loaded only when needed.

Classic example would be color picker. Even though we store color in HEX format as a string, we don't wish to display it as plain text input. For that we can use common/color-picker to display nice color picker on UI part and force correct HEX format in string prop. Meaning if we loaded invalid value from DB for example, prop would be marked as invalid.

Color picker example:

{
  "type": "string",
  "handler": {
    "type": "common/color-picker"
  }
}

Other classic example is any handler. When we use this handler we can set any type of value on prop, mimicking any type in TypeScript.

Last updated

Was this helpful?