Created
November 28, 2014 22:19
-
-
Save ltw/ac9718857c10f2dc5125 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var questions = [{ | |
| choices : [ | |
| { name : "Answer One" } | |
| { name : "Answer Two" } | |
| ] | |
| }, | |
| {}] | |
| $("#questionTmpl").render(questions) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/x-jsrender" id="questionTmpl"> | |
| <li> | |
| <input type="text" name="question[body]" /> | |
| <ul class="choices"> | |
| {{for choices tmpl="choiceTmpl"}} | |
| </ul> | |
| </li> | |
| </script> | |
| <script type="text/x-jsrender" id="choiceTmpl"> | |
| <li> | |
| {{:name}} | |
| </li> | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment