2

I am able to see the lightning component in the community builder.

  • I am also able to drag the component.
  • Also, able to see in the preview mode when clicked on preview.
  • When I publish the changes, the component doesn't load when I browse the live community.

Any inputs? What am I missing?

Thanks

<aura:component controller='NewsListController' implements="forceCommunity:availableForAllPageTypes" access="GLOBAL">

<aura:attribute name="news" type="News_Announcements__c[]"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />

<ul>
    <aura:iteration items="{!v.news}" var="new">
        <li>
            <a href="{! '#/sObject/' + new.Id + '/view'}">
                <p>{!new.News_Title__c}</p>
                <p>{!new.News_Date__c}</p>

            </a>
        </li>
    </aura:iteration>
</ul>

 ({

doInit : function(component, event) {
    var action = component.get("c.findAll");
    action.setCallback(this, function(a) {
        component.set("v.news", a.getReturnValue());
    });
    $A.enqueueAction(action);
      }
  })
5
  • Which component is it ? Standard or custom,? Commented Nov 24, 2016 at 11:55
  • Custom Lightning Component Commented Nov 24, 2016 at 12:15
  • How about sharing abstracted code to see if something we could help you ? Commented Nov 24, 2016 at 12:16
  • just added the .cmp and .js Commented Nov 24, 2016 at 12:30
  • The code is not complete at all .Even if there are apex errors at backend you won't know You may want to use proper patterns for setting the values only when success .Also what does chrome inspect tell you . Commented Nov 24, 2016 at 12:34

1 Answer 1

0

This generally happens when your users does not have permission to access the particular objects which you are using your lightning components.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .