I'm having one method in lightning controller which will call another method in helper class. But it's not executing in the order I coded. I know JavaScript doesn't wait for the response of the previous method to get executed and will move on to the next one.
I know I have to use call back here. But as far as I read "setCallBack" needs to call a server side method to execute.
Please give any idea to proceed on this. Below is my code. I want to disable the lightning button before the alert. But alert comes first and then button is disabled.
Controller:
saving : function(component, event, helper){
component.set("v.dis",'true');
helper.callhelper(component, event, helper);
}
Helper:
callhelper : function (component, event, helper){
alert('After disabling');
}