Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 877 Bytes

clojurescript.org

File metadata and controls

37 lines (24 loc) · 877 Bytes

Access Object Properties

To access an objects properties (including functions you want as a value) use a leading dash:

Here the object `navigator` has a property `geolocation` access like so:

(.-geolocation js/navigator)

Geolocation

navigator.geolocation.getCurrentPosition(showPosition);

To access an objects properties (including functions you want as a value) use a leading dash:

(.getCurrentPosition (.-geolocation js/navigator) (fn [pos] (put! out pos)))

data_tables.core.main(); (.main (-.core js/data_tables))

Debugging

In the browser console you can access your objects via:

(1) change dashes (-) to underscores (_)

So in ns: pcbe-web.views.debug we have a def:

(def cljs-repl-atom (atom “”))

In console as we type, there will be autocompletion