简体   繁体   中英

How to pass an array into Hoplon from a Castra backend

If I am trying to an array into the index.cljs.hl page how do I go about using the array in Clojurescript. I found that I can use:

(loop-tpl :bindings [single-data rpc/test-vector]
    (h2 single-data))

In the hLisp part but if I want to use the array above where the html tag is I seem to run into problems. The array in the rpc.cljs page is as follows

(defc= test-vector    ["Good" "Man" "Shoe"])

And I have tried using map without the data and just an array and it works:

(defn build-list
  []
  (map #(h2 %) ["one" "two" "three"]))

But then if I try and use the array it no longer works and I have no clue why.

(defn build-list
  []
  (map #(h2 %) rpc/test-vector))

Cheers

If you put '@rpc/test-vector' with the last example it works.

Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM