Last active
December 20, 2019 21:19
-
-
Save aarkerio/bb978c34c2f7b702530584293cf8db56 to your computer and use it in GitHub Desktop.
Calling ClojureScript from Hiccup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Clojure hiccup file | |
[:button {:class "btn btn-success" :onClick (str "zentaur.core.deletetest("id")")} "Borrar resgistro"] | |
;; file: src/cljs/zentaur/core.cljs | |
(defn ^:export deletetest [test-id] | |
(when (js/confirm (str "Delete test?")) | |
(set! js/window.location.href (str "/admin/tests/deletetest/" test-id)))) | |
;; ^:export is necessary when the uberjar to production is made. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment