Skip to main content
3 of 3
added 17 characters in body
Mohith Shrivastava
  • 92k
  • 19
  • 161
  • 214

Display Wrapper in lightning component salesforce

I have an apex class as below with a wrapper:

public class lightningController{
    public class ContactWrappertest{
    @AuraEnabled
    public boolean checked {get; set;}
    @AuraEnabled
    public Contact cont {get; set;}
    
    public ContactWrappertest(Boolean isChecked, Contact c){
        this.checked = isChecked;
        this.cont = c;
    }
}

Now when i try to create a lightning component attribute as below and save it:

<aura:component controller="lightningController" implements="force:appHostable" access="global">
    <aura:attribute name="weekWrapList" type= "lightningController.ContactWrappertest[]"/>
 </aura:component>

I get below error on Save: Failed to save lightningComponent.cmp: Invalid aura:attribute type: ContactWrappertest[]: Source

Can someone help me understand the issue here and try to resolve it?

Shrey
  • 151
  • 1
  • 3
  • 10