I'm trying to create a Lightning Component and there is a Custom Apex Controller class with a child class in it.
But I'm receiving an error like this:
Failed to save undefined: No TYPE named apex://MyAccountController.wChildItem[] found : [markup://vctm:AccCtrl]: Source
The code for my Lightning Component looks like this:
Code for .cmp file:
<aura:component controller="MyAccountController">
<!-- Attributes -->
<aura:attribute name="children" type="MyAccountController.wChildItem[]" />
...
...
</aura:component>
Code for APEX Class:
public with sharing class MyAccountController {
@AuraEnabled
public static wChildItem[] findRecords() {
List<wChildItem> items = new List<wChildItem>();
...
...
return items;
}
public class wChildItem {
@AuraEnabled
public string sname { get;set; }
@AuraEnabled
public string stype { get;set; }
public wChildItem(string n, string t) {
sname = n;
stype = t;
}
}
}
Why do I keep getting the no TYPE cannot be found error on save? What is a workaround for this error?