{"action":"created","issue":{"url":"https://api.github.com/repos/ckirkendall/enfocus/issues/107","repository_url":"https://api.github.com/repos/ckirkendall/enfocus","labels_url":"https://api.github.com/repos/ckirkendall/enfocus/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/ckirkendall/enfocus/issues/107/comments","events_url":"https://api.github.com/repos/ckirkendall/enfocus/issues/107/events","html_url":"https://github.com/ckirkendall/enfocus/issues/107","id":167257515,"number":107,"title":"Clone-for and lists","user":{"login":"karneaud","id":2140016,"avatar_url":"https://avatars.githubusercontent.com/u/2140016?v=3","gravatar_id":"","url":"https://api.github.com/users/karneaud","html_url":"https://github.com/karneaud","followers_url":"https://api.github.com/users/karneaud/followers","following_url":"https://api.github.com/users/karneaud/following{/other_user}","gists_url":"https://api.github.com/users/karneaud/gists{/gist_id}","starred_url":"https://api.github.com/users/karneaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karneaud/subscriptions","organizations_url":"https://api.github.com/users/karneaud/orgs","repos_url":"https://api.github.com/users/karneaud/repos","events_url":"https://api.github.com/users/karneaud/events{/privacy}","received_events_url":"https://api.github.com/users/karneaud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-07-24T22:15:59Z","updated_at":"2016-07-27T16:42:11Z","closed_at":null,"body":"I'm new to clojurescript and I'm trying to follow your tutorials\r\n\r\ni have the following markup in html\r\n\r\n```\r\n[:div#questions-panel.panel\r\n  [:h3.question [:span.text]]\r\n  [:ol#answers.answers\r\n    [:li.answer {:value 1} [:p.text]]\r\n  ]\r\n]\r\n```\r\n\r\nI have some json data converted into arraymap\r\n\r\n```\r\n\r\n [ {\"id\":1, \"answer\": 2, \"text\":\"What is your name\",\r\n      \"answers\": [\r\n        {\r\n          \"id\": 1,\r\n          \"text\": \"This an answer\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"text\": \"This an another answer\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"text\": \"This a <b>3rd answer</b>\"\r\n        },\r\n      ]\r\n    }]\r\n```\r\n\r\non  bind/view I do the following to some data\r\n\r\n```\r\n(defn set-question-answers\r\n  [n data]\r\n(ef/at n [\"#answers > .answer:first-child\"]\r\n      (em/clone-for [q data]\r\n        \".text\" (ef/content (:text q))\r\n        ;; (ef/set-attr :value (:id q))\r\n      ))\r\n  )\r\n\r\n(set-question-answers n (:answers data))\r\n```\r\n\r\nI'm trying to clone the `[:li.answer ...` to output more but it doesn't seem to work.... by my understanding the clone-for clones the node ref for each item in the list and adds it to the dom right? so then shouldn't this work?"},"comment":{"url":"https://api.github.com/repos/ckirkendall/enfocus/issues/comments/235645450","html_url":"https://github.com/ckirkendall/enfocus/issues/107#issuecomment-235645450","issue_url":"https://api.github.com/repos/ckirkendall/enfocus/issues/107","id":235645450,"user":{"login":"karneaud","id":2140016,"avatar_url":"https://avatars.githubusercontent.com/u/2140016?v=3","gravatar_id":"","url":"https://api.github.com/users/karneaud","html_url":"https://github.com/karneaud","followers_url":"https://api.github.com/users/karneaud/followers","following_url":"https://api.github.com/users/karneaud/following{/other_user}","gists_url":"https://api.github.com/users/karneaud/gists{/gist_id}","starred_url":"https://api.github.com/users/karneaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karneaud/subscriptions","organizations_url":"https://api.github.com/users/karneaud/orgs","repos_url":"https://api.github.com/users/karneaud/repos","events_url":"https://api.github.com/users/karneaud/events{/privacy}","received_events_url":"https://api.github.com/users/karneaud/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T16:42:11Z","updated_at":"2016-07-27T16:42:11Z","body":"Ok I tried your suggestion\r\n\r\n```\r\n(em/clone-for [q data]\r\n                \".text\" (ef/do->\r\n                  (ev/listen-live :click \".text\" check-is-answer)\r\n                  (ef/html-content (:text q))\r\n                  )\r\n                (ef/this-node (ef/set-attr :value (:id q)))\r\n```\r\n\r\nBut I get the following\r\n\r\n1. This an answer for second question\r\n1. This is the SECOND answer\r\n1. This a 3rd answer\r\n\r\nI try\r\n\r\n```\r\n (ef/this-node (ef/set-attr :value (:id q)))\r\n.text\" (ef/do->\r\n                  (ev/listen-live :click \".text\" check-is-answer)\r\n                  (ef/html-content (:text q))\r\n                  )\r\n              \r\n```\r\n\r\nI get the error\r\n\r\n> Uncaught Error: No protocol method ISelector.select defined for type enfocus.core/t_enfocus$core27385: [object Object]\r\n\r\n\r\nSeems the ef/this-node shifts the context of current node. is this a bug? If not how do I get back into the current node?\r\n\r\nI thought `(ef/at...` would have worked but no dice."}}
{"actor":{"display_login":"karneaud"}}