You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say you have a use case with a param x of type map<string, ?>. This map includes other nested maps as value. Now, assume you need to access x['field1']['field2'] for instance. This does not work out of the box.
Looking at the source code, I tried to mark nested maps as SoyMap with com.google.template.soy.data.SoyValueConverter.markAsSoyMap. Unfortunately, I am still getting this error message:
Line 68 of the soy template contains <div class="container">{$x['field1']['field2']}</div>.
Is SoySauce supporting this use case? as a workaround, I am thinking about flattening nested maps or to define a custom function with "variable args" to get access to the nested fields. If indexed access operators are not supposed to be used in a nested context, what is the recommended approach for the best compliance with the future of closure templates?
The text was updated successfully, but these errors were encountered:
Let's say you have a use case with a param
x
of typemap<string, ?>
. This map includes other nested maps as value. Now, assume you need to accessx['field1']['field2']
for instance. This does not work out of the box.Looking at the source code, I tried to mark nested maps as SoyMap with
com.google.template.soy.data.SoyValueConverter.markAsSoyMap
. Unfortunately, I am still getting this error message:Line 68 of the soy template contains
<div class="container">{$x['field1']['field2']}</div>
.Is SoySauce supporting this use case? as a workaround, I am thinking about flattening nested maps or to define a custom function with "variable args" to get access to the nested fields. If indexed access operators are not supposed to be used in a nested context, what is the recommended approach for the best compliance with the future of closure templates?
The text was updated successfully, but these errors were encountered: