Hey, I'm trying to use kotlinx.html with HTMX, but can't use the hx-get, etc property in the DSL.I'm wondering how I could add it myself or import it directly from HTMX?
p
Peter
08/16/2023, 5:07 AM
You can easily add it either as a method or variable of htmltag and then use it.
Peter
08/16/2023, 5:09 AM
What are you using as serverside framework?
Peter
08/16/2023, 6:01 AM
Small example:
Copy code
fun HTMLTag.hxGet(value: String) {
attributes += "data-hx-get" to value
}
var HTMLTag.hxGet: String
get() = attributes["data-hx-get"] ?: ""
set(value) {
attributes["data-hx-get"] = value