plumatic / dommy

A tiny ClojureScript DOM manipulation and event library
759 stars 74 forks source link

Fix README: dommy.utils is required. #36

Closed kenrestivo closed 11 years ago

kenrestivo commented 11 years ago

Following the example in the README:

"Error evaluating:" (sel ".foo") :as "dommy.utils.__GT_Array.call(null,document.getElementsByClassName(\"span10\"));\n"
#<ReferenceError: dommy is not defined>
ReferenceError: dommy is not defined

The solution was to require dommy.utils.

aria42 commented 11 years ago

Hmm, not seeing that on my end. dommy.core requires dommy.utils, so it should be available in the macro code. What version of the compiler are you on?

cddr commented 11 years ago

I think even a note in the docs about requiring dommy.core would be useful. I was scratching my head for a while wondering why I was getting a "Uncaught ReferenceError: dommy is not defined ". The answer was that I was trying to use a template and although I'd included (:use-macros [dommy.macros :only [deftemplate]]), I hadn't included [dommy.core] in my :require list

timvisher commented 11 years ago

+1 to mentioning requiring dommy.core. I've spent a frustrating fifteen minutes wondering why sel1 was working in one case and not the other that seems to have been solved by adding that to my require list.

aria42 commented 11 years ago

@timvisher @cddr Care to make a PR with a comment that would clearly communicate this? What would've saved you time?

timvisher commented 11 years ago

Not sure how to do this, but I just made a pull request. https://github.com/Prismatic/dommy/pull/43

timvisher commented 11 years ago

To be clear, I did not need to require dommy.utils to make my code work. :)