samedi 20 août 2022

Ember Octane - How to loop through model records inside a component?

I have an array of strings passed as an argument to a component, inside the component I am using "each" helper to render each string in a text input. I tried the following approach.

I have a model passed as an argument to a component. I'm using #each helper to iterate through that model and this does not work.

Example:

  1. Template
<div>
<Location::LocationList @model=""/>
</div>
  1. LocationList component:
<ul class="location-list">
  
    <li>
      
    </li>
  
</ul>

And if I just do it in this way:

<ul class="location-list">
    
      <li>
        <Location::LocationItem @location=/>
      </li>
    
</ul>

It works as needed. Any suggestions?




Aucun commentaire:

Enregistrer un commentaire