Created
October 22, 2013 03:24
-
-
Save dburles/7094730 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
Session.setDefault('forms', 1); | |
Template.main.helpers({ | |
forms: function () { | |
return _.range(1, Session.get('forms') + 1); | |
} | |
}); | |
Template.main.events({ | |
'click .add': function(event, template) { | |
event.preventDefault(); | |
Session.set('forms', Session.get('forms') + 1); | |
} | |
}); | |
<body> | |
{{> main}} | |
</body> | |
<template name="main"> | |
{{#each forms}} | |
{{> form}} | |
{{/each}} | |
<a class="add" href="">+ Add</a> | |
</template> | |
<template name="form"> | |
<form> | |
<input type="text" name="" id=""> | |
</form> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment