Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for array templates to the client-side templates extension #1776

Merged
merged 1 commit into from
Sep 14, 2023
Merged

Add support for array templates to the client-side templates extension #1776

merged 1 commit into from
Sep 14, 2023

Conversation

vadave
Copy link
Contributor

@vadave vadave commented Sep 8, 2023

Resolves #1775 by introducing <template-engine>-array-template renderers that can be used to work with APIs returning arrays of data.

@alexpetros alexpetros changed the title Fix client side template array support Add client side template array support Sep 9, 2023
@alexpetros alexpetros changed the title Add client side template array support Add support for array templates to the client-side templates extension Sep 9, 2023
@alexpetros alexpetros added enhancement New feature or request ready for review Issues that are ready to be considered for merging labels Sep 9, 2023
@1cg 1cg merged commit e3a68c5 into bigskysoftware:dev Sep 14, 2023
1 check passed
@1cg
Copy link
Contributor

1cg commented Sep 14, 2023

beautiful, great solution!

@biocarl
Copy link

biocarl commented Nov 2, 2023

Are you aware that at least moustache templates allow to reference the current context with .? So when passing in an array (e.g. [{"a":2, "b":4}, {"a":3, "b":4}] you can simply do:

{{#.}}  
    <h3>{{a}}</h3>
    <p>{{b}}</p>
{{/.}}

Resulting in

<h3>2</h3>
<p>4</p>
<h3>3</h3>
<p>4</p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready for review Issues that are ready to be considered for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants