Developing a lightning component for community to display a formula field from custom object to the community page.
getting following error
Component class instance initialization error [Cannot read property 'apply' of undefined] Failing descriptor: {markup://siteforce:designTimeComponent}
Component looks as below
<aura:attribute name="OlympicReward" type="Olympic_Rewards__c[]"/>
<ui:button label="Check Reward status" press="" />
<aura:iteration var="OLRS" items="{!v.OLR}">
<p>{!OLRS.Reward_level__c}</p>
</aura:iteration>
Component controller
({
getOLS : function(component, event, helper) {
var action = component.get("c.getOR");
action.setCallback(this, function(response)){
var state = response.getState();
if(state === "SUCCESS"){
componnet.set("v.OLR", response.getReturnValue());
}
});
$A.enqueueAction(action);
}
})
Apex Class
public with sharing class Olympic {
@AuraEnabled
public static Olympic_Rewards__c getOR() {
Olympic_Rewards__c OLR =
[SELECT Id, Name, StatusBar__c,Reward_level__c,Agency_Name__c,Agency__c from Olympic_Rewards__c
WHERE
Agency__c IN (SELECT AccountId FROM User WHERE Id = :UserInfo.getUserId())LIMIT 1];
return OLR;
}
}