0
我有這樣的代碼:獲取JSON對象Clojure中
(defn my-journey-page [locale]
(render-string
(read-template "myJourney") {:api (:api props)
:feedback (:feedback props)}))
...
(def props (get-props))
...
(def default-props {:api "https://dev"
:feedback (json/write-str {:feedback {:en "en" :fi "fi" :sv "sv"}
:survey {:en "en" :fi "fi" :sv "sv"}})})
,我需要幫助把一個有效的JSON對象反饋關鍵。我使用clostache作爲模板。在目前的情況下,它返回:
var obj = {
feedback: '{"feedback":{"en":"en","fi":"fi","sv":"sv"},"survey":{"en":"en","fi":"fi","sv":"sv"}}'
}
我該如何正確得到它?
其實我用clostache。我會用它更新問題 –
好的,我的答案應該適用於所有基於鬍子的模板系統。 –
是的,謝謝! –