Hi all,
I'm learning om, and have finished a simple form with validation.
Now I wanted to add om-sync to this, but fail miserably.
I've now narrowed it down to:
(def app-state
(atom
{:pass {:url "http://localhost:3000/pass/t56780000017/"
:coll {:name {:key "name"
:label "Name"
:value "I*can*t*believeThis"
:type "text"
:hint "max. 30 Zeichen"
:validate "max-30"}}}}))
(defn input-form [app owner]
(prn app)
(reify
om/IRender
(render [this]
(dom/form #js {:role "form"}
; deleted any real functionality for testing
(dom/span nil "finally working! %"&ยง%/*!!") ))))
(defn app-view [app owner]
(prn "app-view" (get-in app [:pass :coll]))
(reify
om/IRenderState
(render-state [_ {:keys [err-msg]}]
(dom/div nil
;; delete most of om-sync opts to find the error. the error stays the same
;; before, this was straight from the example...
(om/build om/om-sync (:pass app)
{:opts {:view input-form}})))))
(om-sync.util/edn-xhr
{:method :get
:url (str "http://localhost:3000/pass/" "t56780000017" "/")
:on-complete
(fn [res]
; stop using remote state for testing (although loading works fine...)
;(reset! app-state res)
(om/root app-view app-state
{:target (.getElementById js/document "om-test")})
)})
Any ideas where to look / what to do highly welcome. I spent hours on this
allready, without the slightest idea where it's coming from...
om 0.5.2 / cljs -2173 / om-sync 0.1.1
Thanks, Mathias
--
Note that posts from new members are moderated - please be patient with your
first post.
---
You received this message because you are subscribed to the Google Groups
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.