StubbleOrg / Stubble

Trimmed down {{mustache}} templates in .NET
Other
399 stars 58 forks source link

How can I solve nested stubble values from mustache #110

Closed dhruvalShahTatvasoft closed 3 years ago

dhruvalShahTatvasoft commented 3 years ago

Example is as below: {{ config.mapping.value[ {{ input.Id}} ] }}

Here, config and input is the provided Json objects, and I want to access it's values.

Romanx commented 3 years ago

Hi there,

In mustache you're not able to perform templating inside your tags. You could make a lambda which would return you the value when you run the template however the recommended approach is to massage your inputs into a "good" shape before templating so there is no logic in your templates.

Hopefully that helps.