freemarker.js icon indicating copy to clipboard operation
freemarker.js copied to clipboard

Handing Objects to Templates

Open HoverBaum opened this issue 8 years ago • 0 comments

Stumbled upon a problem with handing Objects to templates and then working with them.

My use case: Hand an Object to a template, use a freemarker function to turn it into a string, assign that string to a JS variable.

I created a minimal example to illustrate my problem at https://github.com/HoverBaum/test-freemarker-variables

What I am experiencing is that accessing properties of my Object gives me byte buffers.
I managed to find a hackaround by passing my Object as a JSON string and converting that to a FreeMarker Object. However I feel like this should not be necessary and it breaks some chinese characters.

Possibly related to #16 who seems to want to do something similar and #11 who has problems with Chinese characters.

HoverBaum avatar May 05 '16 08:05 HoverBaum