javascript - Meteor show spinner on method call -
i have button calls method. when method called, have button change , show spinner (inside button itself).
i have made button , css it.
however, lost in how hook functionality show spinner when method called , stop showing when method returns successfully.
how can this? (using template.subscriptionready
?)
a simple solution activate spinner in event handler , deactivate in method call callback once method on server has returned or finished:
'click #methodbutton' : () => { activatespinner(); meteor.call('some method', (err, res) => { if(err) throw err; deactivatespinner(); }); }
Comments
Post a Comment