BorisMoore / jsrender

A lightweight, powerful and highly extensible templating engine. In the browser or on Node.js, with or without jQuery.
http://www.jsviews.com
MIT License
2.68k stars 340 forks source link

(How) can this be used to translate objects into objects? #275

Closed Redsandro closed 9 years ago

Redsandro commented 9 years ago

I love how versatile this is. I use it for templating.

For a case I would like to translate one object into another object. I don't want to create a JSON template and then JSON.parse it because of the added overhead.

Can this be modified to do that, or do you know anything similar-ish that doesn't output a string but rather an object?

Full disclosure.

BorisMoore commented 9 years ago

Yes, you can do that in a few ways. For example see this sample - in response to your Stack Overflow question

Redsandro commented 9 years ago

This is a very nice example. Thank you. :+1: