I want to make recursive call in js controller on my lightning component.. Following is my js controller but I am getting an error as
'callback' must be a valid Function
check : function(component, event, helper) {
var str = component.get('v.message');
if(str == null){
str = '';
}
$A.getCallback(helper.check(component,str),1200);
}
ControllerHelper Code :
check : function(cmp,a) {
var msg = 'Welcome to Dairy Startup';
if(a.length < msg.length){
a = msg.substring(0,a.length + 1);
cmp.set('v.message',a);
}
}
How Can I make recursive call to helper method?