You need to sign in to do that
Don't have an account?
Srt
Opportunities are not displayed with below code, Why? I am new to learning Lightning Design System and this is my first code
Application: <aura:application > <c:Check/> </aura:application>
Component: <aura:component controller="OpportunityView"> <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> <aura:attribute name="Opplist" type="object" /> <p> Below is the list off accounts </p> <aura:iteration items="{!v.Opplist}" var="a"> <li><ui:outputText Value ="{!a.name}"/> </li> </aura:iteration> </aura:component>
Controller: ({ doInit : function(component, event, helper) { helper.showcontact(component); } })
Helper: ({ showcontact : function(component) { var comp = component.get("c.getOpportunities") comp.setCallback(this,function(a){ component.set("v.Opplist", a.getReturnValue()); }); $A.enqueueAction(comp); } })
Apex Controller: (OpportunityView.apxc) public class OpportunityView { @auraenabled Public static list<Opportunity> getOpportunities() { return [ select ID,Name from Opportunity]; } }
-Rajiv