How to Use Wrapper Class In Salesforce Lightning Component?
How to Use Wrapper Class In Salesforce Lightning Component?
A wrapper or container class is a class, a data structure, or an abstract data type which contains different objects or collection of objects as its members.
A snippet of code for Wrapper Class :
To use a variable in lightning use @AuraEnabled Annotation before the variable name. Above wrapper class can be use to show account Details and all its related contact.
A snippet of code for Lightning Component :
JavaScript Controller for Lightning component :
Helper For Lightning Component :
Salesforce Apex Controller :
The above lightning component is embedded in a visual force page.
A snippet of code for Salesforce Visualforce Page :
Your Lightning Component Look like Below ScreenShot :
References:
https://salesforce.stackexchange.com/questions/117627/wrapper-class-knowledgearticleversion-knowledgearticle-for-caseassociation-c
http://sfdcmonkey.com/2017/07/06/use-wrapper-class-lightning-component/