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);
      }
  })
  • Which component is it ? Standard or custom,? – Mohith Shrivastava Nov 24 '16 at 11:55
  • Custom Lightning Component – Roshan Sahatiya Nov 24 '16 at 12:15
  • How about sharing abstracted code to see if something we could help you ? – Mohith Shrivastava Nov 24 '16 at 12:16
  • just added the .cmp and .js – Roshan Sahatiya Nov 24 '16 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 . – Mohith Shrivastava Nov 24 '16 at 12:34
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.