Last active
January 4, 2019 07:37
-
-
Save sasikanth513/b9edcdacc10930c5cd3e5f4221d76494 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
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