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
Hello, first of all congratulations for the excellent work and lightning fast engine:
One thing I've being trying is to port the concept of partials, like in mustache {{> partial_name}}, but it seems that it doesn't interpolates the result.
vardata={name: 'John',details : {age : 27},partial : "<p>Hello again {{= it.name}}</p>"};doT.template('Hello {{=it.name}}, you are {{=it.details.age}} years old! {{= it.partial }}')(data)//outputs...// Hello John, you are 27 years old!// Hello again {{= it.name}}
As you can see the partial is not interpolated, so I was wondering if its possible to have this using doT?
perhaps something like mustache or handlebarsjs where I can do the following:
Thanks! Compile-time evaluation with {{#defs.xxx}} could be used for this, but it was limited... until today :)
Today, I pushed changes to compile-time evaluation so that it works much better for cases like this and it also allows to define reusable snippets right in the template that could be used in the same template or included templates.
Please take a look at examples/advancedsnippet.txt for an example.
Is this what you were looking for?
Hello, first of all congratulations for the excellent work and lightning fast engine:
One thing I've being trying is to port the concept of partials, like in mustache
{{> partial_name}}
, but it seems that it doesn't interpolates the result.As you can see the partial is not interpolated, so I was wondering if its possible to have this using doT?
perhaps something like mustache or handlebarsjs where I can do the following:
dot.template('...')({data: {...}, partials : {...}})
Thanks again :)
The text was updated successfully, but these errors were encountered: