Created
February 18, 2014 20:38
-
-
Save davidworkman9/9079568 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 errors = new Meteor.Collection(null); | |
Template.my_templ.errors = function () { errors.find().fetch(); }; | |
Template.my_templ.events({ | |
'submit': function () { | |
if ($('#firstName').val() === '') { | |
errors.push({ msg: 'First Name Required' }); | |
} | |
} | |
}); |
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
<template name="my_templ"> | |
{{#each errors}} | |
<div class="alert alert-danger"> | |
<button type="button" class="close" data-dismiss="alert">×</button> | |
{{msg}} | |
</div> | |
{{/each}} | |
<input id="firstName" /> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment