Error formatting macro: pagetree: java.lang.NullPointerException

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


In this example, this would be bound to each element in turn retrieved by the selector $('li') and processed in the each loop. techniques of this sort pull this off by explicitly passing a value for the implicit this to the target function as an argument to the call method. In other words, something (in spirit) like:

No Format
    (defn f [] (.x js/this))
    ;=> #<[object Global]>undefined

     (.call f (js* "{x : 9}"))
    ;=> #<[object Object]>

This is effectively what goog.bind does, so this type of behavior should just work using ClojureScript functions.