I have a class hierarchy starting with abstract class and going multiple levels deep. Every class in the hierarchy has a number of @AuraEnabled attributes.
Top level class
public abstract class MyAbstractClass
{
@AuraEnabled
public String attFromAbstractClass { get; set; }
public MyAbstractClass()
{
attFromAbstractClass = 'hello';
}
}
Class that extends it
public class MyClass extends MyAbstractClass
{
@AuraEnabled
public String myAtt { get; set; }
public MyClass()
{
super();
myAtt = 'world';
}
}
Controller class
public class CmpCtrl
{
@AuraEnabled
static public MyAbstractClass getResult()
{
return new MyClass();
}
}
Aura Application
<aura:application extends="force:slds" controller="CmpCtrl">
<aura:handleEvent name="init" value="{!this}" action="{!c.init}" />
</aura:application>
Aura Application Controller
({
init: function(cmp,evt,h) {
var action = cmp.get('c.getResult');
action.setCallback(this, function(servResp){
var state = servResp.getState();
if(state === 'SUCCESS') {
console.log(servResp.getReturnValue());
}
}, 'ALL');
$A.enqueueAction(action);
}
})
The output of the server response is an object with only myAtt visible. How do I access attFromAbstractClass from the response?