javascript - AngularJS How to restrict double/multiple click -


I know that click and drag buttons on angular js for double / multi click; After completing AJAX processing by NG-Disabled, enable it, please suggest any other best way to deal with double click in angularJS ...

Our code will call the Ajax method on button click & amp; ; The process will take small amounts; Get data from DB

I do not have to allow Ajax to click on progress ...

Welcome to NG-Handicapped, I am a learner of AngularJS

createDialogService ( 'ajs / common / templates / popup / Config_reminder_popupkhtml ", {title: IsFrom, background is true, the controller:" ConfigRemindersCBController', FooterTemplate: '+ verb +'});

  $ scope.saveOrUpdateReminder = function (reminder) {if ($ scope.isDisabled) {return; } $ Scope.isDisabled = true; if (! reminder.daysBeforeAfterCheckDate || reminder.daysBeforeAfterCheckDate === '') {alertService.openValidatPopup ( 'Enter before just days end. "," Error ", really,' ConfigRemindersCBController ',' right ',' u1_remove .png '); $ Scope.isDisabled = false; Return; } ConfigRemindersService.isDaysBeforeAfterCheckDate ($ scope.objectId, Reminder, Function (Results) {if Reminder.selectedMessageTemplate.messageId || reminder.selectedMessageTemplate.messageId === '') {alertService.openValidatPopup (Please select Message Template . "," error ", really, 'ConfigRemindersCBController', 'right', 'u1_remove.png'); $ scope.isDisabled = false; return;} else if (reminder.selectedReminderSendOption.reminderSendOptionValue || reminder.selectedReminderSendOption.reminderSendOptionValue ==! = '') {AlertService.openValidatPopup ('Please choose to send reminder options', "error", true, 'configRemindersCBController', 'OK', 'u1_remove.png'); $ scope.isDisabled = false; EnableReminder; Return on;} (result on Nam === 'no') {if (reminder. Enable === true) {EnableReminder = 'Enable';} else {enable Rimnder = Disable '';} configRemindersService .addOrUpdateReminderConfigLine ($ scope.objectId, reminders , Enabled reminder, function (Reminder Response) {var Reminder = Reminder Response Reminder Configline; $ Root scope. CONFIG = JSON. (Reminder Response Confident); $ Scope $ modalClose () .; $ Scope.isDisabled = false; _.filter (configRemindersService.getMessageTemplates (), function (MSG) {if (reminder.messageTemplateId === msg.messageId) {reminder.selectedMessageTemplate = msg;}}); _.filter (configRemindersService.getReminderSendOptions (), function (option) {if (reminder.reminderSendOption === option.reminderSendOptionValue) {reminder.selectedReminderSendOption = option;}}); If (configRemindersService.getIsFrom () === 'Create Reminder') {configRemindersService.getReminders (). Push (reminder); } Other {configRemindersService.getReminders () [configRemindersService.getIndex ()] = Reminders; }}); }}); };  

NG-disabled is definitely the right way to go with it - it's ready

If you have to disable it without seeing it inactive, then you have 2 options:

  1. Changing CSS for the handicapped is a visible state enabled.
  2. Duplicate it with a scope variable, which only works when set.

For the second:

  $ scope.stopClick = false; $ Scope.buttonClick = function () (if ($ scope.stopClick) {return;} $ Scope.stopClick = true; & lt; .. code .. callback: function (data) {$ scope.stopClick = False;}};  

This will accomplish the goal, but it is changing the wheel again and is probably less robust than disabling the element and resting it.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -