Collect parameters and partials

26 views
Skip to first unread message

jmurray

unread,
Jul 17, 2018, 2:26:29 PM7/17/18
to handlebars.java
I have a UI which allows people to test emails based on templates. Part of the UI uses  'var tokens = Mustache.parse(template_text)' to create a list of tokens, which I filter out nodes of type 'name'. Then I display those names with input fields so the user can supply values.

I have an equivalent method in the java backend that uses '
Template template = handlebars.compileInline(text); template.collect();' to find all the tags in a template as well.

I have recently added support for partials and realized that 
template.collect() does not 'drill into' the partials and return those tags. I have not tested Mustache.parse() with templets containing partials yet. I was wondering what is the expected behavior of javascript Mustache.parse() and JAVA template.collect() with regard to partials. Is there a way to compute all the tags in nested templates using the the Mustache engine?

Thanks
Reply all
Reply to author
Forward
0 new messages