Closed turtle-bazon closed 10 years ago
I have html template
<html> <head> <script src="js/main.js"></script> </head> <body> <div id="container"> </div> <div id="templates" style="display:none"> <p>[templates]</p> <div id="main-block"> <div id="clist">[container]</div> </div> <ul id="lllist"> <li>e1</li> <li>e2</li> <li>e3</li> </ul> </div> </body> </html>
also have core.cljs
(ns suopelmen.client.core (:require [ajax.core :as ajax] [enfocus.core :as ef] [enfocus.events :as ev]) (:require-macros [enfocus.macros :as em])) (em/defsnippet userlist-block "/t2.html" ["#lllist"] [] "li ~ li" (ef/remove-node) "li:first-child" (em/clone-for [user [{:id 1 :name "adfgadf"} {:id 2 :name "qertqert"} {:id 3 :name "pouiyi"}]] (ef/content (name user)))) (em/defsnippet main-block "/t2.html" ["#main-block"] [] "#clist" (ef/content "") "#clist" (ef/content (userlist-block))) (defn init [] (ef/at "#container" (main-block))) (set! (.-onload js/window) #(em/wait-for-load (init)))
But in that example clone-for doesn't work as I await from him. In javascript console I see message "TypeError: enfocus.core.last_element_child is undefined". And in fact it doesn't present in main.js. Whats wrong in my template or cljs?
ater deleting main.js and target/cljsbuild-compiler-0 works as expected.
I have html template
also have core.cljs
But in that example clone-for doesn't work as I await from him. In javascript console I see message "TypeError: enfocus.core.last_element_child is undefined". And in fact it doesn't present in main.js. Whats wrong in my template or cljs?