Skip to content

Instantly share code, notes, and snippets.

@sasikanth513
Last active January 4, 2019 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sasikanth513/b9edcdacc10930c5cd3e5f4221d76494 to your computer and use it in GitHub Desktop.
Save sasikanth513/b9edcdacc10930c5cd3e5f4221d76494 to your computer and use it in GitHub Desktop.
import { Meteor } from "meteor/meteor";
Template.mainLayout.onCreated(function () {
const self = this;
self.dataDict = new ReactiveDict();
self.dataDict.set('submitingCreateUserForm', false);
})
"submit #createUserForm": function(e, t) {
// before calling meteor method
t.dataDict.set('submitingCreateUserFormngForm', true);
t.dataDict.set('createUserResponse', false);
Meteor.call('users.insert', ...params, (err, res) => {
t.dataDict.set('submitingCreateUserFormngForm', true);
if (err) {
// show error to user
} else {
// save result in datadict
t.dataDict.set('createUserResponse', res);
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment