You need to sign in to do that
Don't have an account?
Aruna
How to call one helper or controller function variables or results into another funcation
Hi I need to access the helper2 variable in the helper1 method for example
Sample apex class Public class SampleApexCls{ @AuraEnabled public static List<String> testSmapleMethod(){ //some code here Return ListofValues; } @AuraEnabled public static Map<Id,String> testSmapleMethod2(){ //some code here Return map; } }
({ getSmapleData :function(component){ var action=component.get("c.testSmapleMethod"); action.setCallback(this,function(response){ var returnValue=response.getReturnValue(); this.getSmapleData1 (component) // I know how to call the funcation // Whant to get "returnValue2" results in this method. }); }, getSmapleData1 :function(component){ var action=component.get("c.testSmapleMethod2"); action.setCallback(this,function(response){ var returnValue2=response.getReturnValue(); }); } }) how do I access "returnValue2" in "getSmapleData" funcation. can "getSmapleData1" return some value. can any please help to get the one funcation values or varaible to display in other funcation like how we do in general apex class
I don't think we have an option to call one method in another method within the controller, whereas we can do that inside the helper bundle.
Find the working code and modify based on your requirements
Component: Controller js file: Helper js file:
Output in the browser console:
Test this and share the results.
Naveen
Team codengine.in