Event compiler
Angular-style events, outside the Flowmark template syntax.
Handlers live in Astro frontmatter and are moved into a small client module when the template uses event attributes.
Click an action to see the compiled event handlers run.
---
function save(event) {
const output = document.querySelector("#event-output");
output.textContent = `Saved from a ${event.type} event`;
}
function removeItem(id, element) {
element.setAttribute("disabled", "true");
output.textContent = `Removed ${id}`;
}
---
<button data-flow-on-click="save" data-flow-args="[{"__flow":"$event"}]">Save</button>
<button data-flow-on-click="removeItem" data-flow-args="["item-1",{"__flow":"$el"}]">Remove</button>