I want to include an atomic pattern and want to pass data from a JSON array below is code and JSON file.
anchor-link.mustache
<a href="{{ url }}" class="{{ class }}">{{ label }}</a>
footer-nav.mustache
<ul class="menu vertical">
{{# footerNav }}
<li>{{> atoms-anchor-link(url:url, label : label, class : class) }}</li>
{{/ footerNav }}
</ul>
JSON from where i want to populate anchor mustache
{
"footerNav": [{
"label": "Shop",
"url": "#",
"class": "body-copy"
}, {
"label": "Pods",
"url": "#",
"class": "all-caps-large"
}]
}
Output
<ul class="menu vertical">
<li><a href="" class=""></a>
</li>
<li><a href="" class=""></a>
</li>
</ul>
Pattern Lab is generating correct HTML and creates anchors but no values are populating in anchors.
Thanks in advance!!!!
You have called wrong pattern here.
Correct pattern is.
This will work.