I have a map attribute that holds the following map<string,list<SObject>> I want to iterate over the map and pass the list down to a child component but keep getting an error.

This is what I have so far:

Parent component

<aura:attribute name="mapOfThings" type="map" />

<aura:iteration items="{!v.mapOfThings}" var="m">
        <childComponent listOfThings="{!m.value}"/>

Child Component

<aura:attribute name="listOfThings" type="list" />

<aura:iteration items="{!v.listOfThings}" var="l">

When the component loads I get the following error:

Uncaught Assertion Failed!: Unable to get value for key 'm.value'. No value provider was found for 'listOfThings'. : false

I can make it work if I didn't have a child component but in this scenario I must have them separate

  • 2
    Is {!m.value} a list? What does your data look like? – sfdcfox Jul 17 '18 at 22:57
  • Assume you meant map<string,list<SObject>> based on your question, so have made that update in your question. If not, please make necessary changes. – Jayant Das Jul 17 '18 at 23:10
  • @JayantDas yes I did, must of overwritten it! thanks – JPG Jul 18 '18 at 8:19

I had a typo in my child component and was referencing {!m.value} again, hence the error!

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.