When you’re using an <aura:attribute> that is an instance of a custom Apex Class, you need to use the following approach:
- Any methods in your class that you want to access from client-side logic must be declared as Static
- the @AuraEnabled annotation must be used on those methods as well
- Any properties of the class that you wish to access on the Lightning Component must ALSO have the @AuraEnabled annotation
As for #3… In my efforts today, I was using <aura:iteration> to create a set of select options that were iterating over a list of custom wrapper classes. I could not get the values of my custom class object properties to show up on the page, until I realized you have to use this annotation on Properties as well as Methods.
Hopefully this saves you the hour I spent trying to debug my output!