Firstly, :import in ClojureScript only supports symbols as libspecs,
so you'd need to write
(:import goog.ui.Button)
(foo Bar Quux) support could be added easily, but currently
ClojureScript's ns form doesn't support the equivalents for :require
and :use, to it makes sense to expect full names
Hmm, I'm stuck again. :)
I don't know why, but it seems that building the project with *
lein-cljsbuild* does not accept :import. Here's the code:
(ns habarnam
(:use [domina :only [xpath]])
(:import [goog.ui [Button]])
And here's the compilation error:
Compiling ClojureScript.
Compiling
I found the cause after looking at google closure more closely. The
following is wrong:
goog.require('goog.ui');
It must be:
goog.require('goog.ui.Button');
So the correct clojurescript code is:
(ns test
(:import goog.ui.Button))
(.render (new Button "Hello!") (goog.dom/getElement "b1"))
Hi,
I am currently unable to get to the bottom of a "undefined nameToPath"
error in clojurescript. Here's the script:
*test.cljs:*
(ns test
(:require [goog.dom :as gdom] [goog.ui :as gui]))
(.render (new gui/Button "Hello!") (gdom/getElement "b1"))
And the compiled output:
*test.js (compile