Database Reference
In-Depth Information
4.
From the command line, enter this command. This will start the ClojureScript
compiler that watches all the ClojureScript iles and automatically compiles them
whenever we save one:
$ lein cljsbuild auto
Compiling ClojureScript.
Compiling "resources/js/scripts.js" from "src-cljs"...
Successfully compiled "resources/js/script.js" in 4.707129
seconds.
5. Next, we'll add our compiled ClojureScript ile to our Hiccup template. Let's open
src/web_viz/web.clj again and change the index-page function to look as
shown here:
(defn index-page []
(html5
[:head
[:title "Web Charts"]]
[:body
[:h1 {:id "web-charts"} "Web Charts"]
[:ol
[:li [:a {:href "/data/census-race.json"}
"2010 Census Race Data"]]]
(include-js "js/script.js")
(javascript-tag
"webviz.core.hello('from ClojureScript!');") ]))
Now when we start the Ring server and look at the main page, we should see the
following screen:
 
Search WWH ::




Custom Search