Home mustache partial not looping through the data passed down to it
Reply: 0

mustache partial not looping through the data passed down to it

user1178
1#
user1178 Published in April 22, 2018, 6:16 pm

I am using mustache in conjunction with enter link description herepattern lab to render out a list of items from a json data file. Given this data structure:

{
  "states": {
    "dropdown": {
      "items": [
        {
          "title": "CA"
        },
        {
          "title": "OR"
        },
        {
          "title": "TX"
        }
      ]
    }
  },
  "roles": {
    "dropdown": {
      "items": [
        {
          "title": "Mid-level Office Manager"
        },
        {
          "title": "Facility Manager"
        },
        {
          "title": "Resources Coordinator"
        }
      ]
    }
  }
}

If I do the following within my partial:

{{#states}}
  {{#dropdown.items}}{{title}}{{/dropdown.items}}
{{/states}}

The names render out fine.

But if I do this:

{{#states}}
  {{> molecules-dropdown-picker(btnDropdownToggleLabel: "OR")}}
{{/states}}

Where the dropdown picker partial has the following code:

{{#dropdown.items}}{{title}}{{/dropdown.items}}

It won't render. What am I doing wrong?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.30936 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO