Guest User

Untitled

a guest
Mar 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. Template.myTemplate.events({
  2. 'submit #myForm': function(event) {
  3. event.preventDefault();
  4. Meteor.call('myMethod', function(error, response) {
  5. //
  6. });
  7. },
  8. });
  9.  
  10. Meteor.methods({
  11. myMethod: function() {
  12. try {
  13. return (Collection.insert({
  14. data: 'Hello world'
  15. })) ? true : false;
  16. } catch(e) {
  17. throw new Meteor.Error(e);
  18. }
  19. }
  20. });
Add Comment
Please, Sign In to add comment