I when I press button, I get a lightning alert popup with an error:
Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details.Something has gone wrong. Cannot read property '$getActionDef$' of undefined. Please try again.
Apex:
public class AuraCtrl {
@AuraEnabled
public String getFoo() {
return 'OLOLO';
}
}
Lightning:
<aura:component controller="AuraCtrl" implements="force:appHostable,flexipage:availableForAllPageTypes">
<aura:attribute name="barAttr" type="String"/>
<ui:inputText aura:id="barId" label="Bar input" value="{!v.barAttr}"/>
<ui:button label="Press for Bar!" press="{!c.doGetBar}"/>
</aura:component>
JS Ctrl:
({
doGetBar : function(component, event) {
var action = component.get("c.getFoo");
// another code does not matter because all breaks with first line
}
})