You need to sign in to do that
Don't have an account?
Medhanie Habte 37
Lightning Component Framework Specialist Superbadge Step 8
Hi All, I'm slowly but surely moving forward with this superbadge, but seem to be stuck on Step 8....
Challenge Not yet complete... here's what's wrong:
TheFiveStarRating component doesn't have a change event listener that invokes a controller function named onValueChange. onValueChange should fire when the value attribute of the component is changed.
Challenge Not yet complete... here's what's wrong:
TheFiveStarRating component doesn't have a change event listener that invokes a controller function named onValueChange. onValueChange should fire when the value attribute of the component is changed.
<aura:component implements="flexipage:availableForAllPageTypes"> <aura:attribute name="value" type="Integer" default="0"/> <aura:attribute name="readOnly" type="boolean"/> <aura:handler name="onValueChange" value="{!v.value}" action="{!c.onValueChange}"/> </aura:component>
({ afterScriptsLoaded : function(component, event, helper) { // var domEl = [get dom element of rating area] // var currentRating = [get value attribute of component] // var readOnly = [get readonly attribute of component] var maxRating = 5; var callback = function(rating) { component.set('v.value',rating); } component.ratingObj = rating(domEl,currentRating,maxRating,callback,readOnly); }, onValueChange: function(component,event,helper) { if (component.ratingObj) { var value = component.get('v.value'); component.ratingObj.setRating(value,false); } } })
Change your aura:handler to the following and try revalidating:
Also, before you validate, you'll want to test your component to make sure it's working.