You need to sign in to do that
Don't have an account?
SaurabhDua
Here is my component
<aura:component>
<aura:attribute name="boat" type="BoatType__c" access="public"/>
<aura:handler name="change" value="{!v.boat}" action="{!c.refresh}"/>
<!-- set up the aura:method for refresh -->
<aura:method name="refresh" action="{!c.doInit}" access="public"
description="BoatDetailsController.js invokes refresh whenever boat is updated">
</aura:method>
<ui:scrollerWrapper class="scrollerSize">
<!--Scrollable content here -->
<aura:if isTrue="{!v.boatReviews.length==0}">
<lightning:layoutItem class="slds-align_absolute-center" flexibility="auto" padding="around-small">
<ui:outputText value="No Reviews Available" />
</lightning:layoutItem>
</aura:if>
<div class="slds-feed">
<ul class="slds-feed__list">
<aura:iteration items="{!v.boatReviews}" var="boatReview">
<li class="slds-feed__item">
<div class="slds-media__body">
<div class="slds-grid slds-has-flexi-truncate">
<a href="javascript:void(0)" onclick="{!c.onUserInfoClick}"
data-userid="{!boatReview.CreatedBy.Id}">
{!boatReview.CreatedBy.Name}
</a>
— {!boatReview.CreatedBy.CompanyName}
</div>
<p><lightning:formattedDateTime value="{!boatReview.CreatedDate}"
year="numeric" month="short" day="numeric"
hour="2-digit" minute="2-digit" hour12="true"/></p>
</div>
</li>
</aura:iteration>
</ul>
</div>
</ui:scrollerWrapper>
</aura:component>
Lightning Component Framework Specialist-- step 8
Help needed with the below error
Here is my component
<aura:component>
<aura:attribute name="boat" type="BoatType__c" access="public"/>
<aura:handler name="change" value="{!v.boat}" action="{!c.refresh}"/>
<!-- set up the aura:method for refresh -->
<aura:method name="refresh" action="{!c.doInit}" access="public"
description="BoatDetailsController.js invokes refresh whenever boat is updated">
</aura:method>
<ui:scrollerWrapper class="scrollerSize">
<!--Scrollable content here -->
<aura:if isTrue="{!v.boatReviews.length==0}">
<lightning:layoutItem class="slds-align_absolute-center" flexibility="auto" padding="around-small">
<ui:outputText value="No Reviews Available" />
</lightning:layoutItem>
</aura:if>
<div class="slds-feed">
<ul class="slds-feed__list">
<aura:iteration items="{!v.boatReviews}" var="boatReview">
<li class="slds-feed__item">
<div class="slds-media__body">
<div class="slds-grid slds-has-flexi-truncate">
<a href="javascript:void(0)" onclick="{!c.onUserInfoClick}"
data-userid="{!boatReview.CreatedBy.Id}">
{!boatReview.CreatedBy.Name}
</a>
— {!boatReview.CreatedBy.CompanyName}
</div>
<p><lightning:formattedDateTime value="{!boatReview.CreatedDate}"
year="numeric" month="short" day="numeric"
hour="2-digit" minute="2-digit" hour12="true"/></p>
</div>
</li>
</aura:iteration>
</ul>
</div>
</ui:scrollerWrapper>
</aura:component>
In BoatReviews.cmp
Use
<aura:attribute name="boat" type="Boat__c" access="public"/>
instead of
<aura:attribute name="boat" type="
BoatType__c" access="public"/>Please mark it as SOLVED . It worked for me!
All Answers
In BoatReviews.cmp
Use
<aura:attribute name="boat" type="Boat__c" access="public"/>
instead of
<aura:attribute name="boat" type="
BoatType__c" access="public"/>Please mark it as SOLVED . It worked for me!
follwing helped me
# 1 add an apex class BoatReviews.apex most important the dependency you might need to revisit just in case....
#2 fyi refrence how my BoatReviews.cmp loooks BoatReviewsController.js
BoatDetails.cmp and BoatDetailsController.js