Component Code:
<aura:component controller="TestController" implements="forceCommunity:availableForAllPageTypes">
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="country" type="Contact" default="{ sobjectType: 'Contact' }" />
<ui:inputSelect label = "country" aura:id="InputSelectDynamic">
<aura:iteration items="{!v.country.Country__c}" var="CountryName">
<ui:inputSelectOption text="{!CountryName}" label="{!CountryName}"/>
</aura:iteration>
</ui:inputSelect>
</aura:compomnent>
Controller Code
({
doInit: function(component, evt, helper) {
var action = component.get("c.getAccount");
action.setCallback(this, function(a) {
component.set("v.country", a.getReturnValue());
});
$A.enqueueAction(action);
},
})
Apex Controller
public class TestController{
@AuraEnabled
public static Account getAccount() {
return [select Country__c from Contact];
}
}
Question : I am not getting any record in the drop down , can any one tell me what is wrong with the code. my controller is having simple SQL select query and that is working fine.