Closed mani95lisa closed 10 years ago
What you show seems fine. It outputs ok as I would expect. The eq helper is comparing the key parameter which is a string interploated with the value of path giving "/console" to the value parameter which is exactly the same string so "ok" is output. What is unclear?
@rragan I'm clear what you say, but I don't got ok
. I'm a little confused, I'll have a look again.
Thanks!
@rragan I tried again:
{path}
{@eq key="{path}" value="/console"} ok {/eq}
and I just got:
/console
it should be
/consoleok
What's wrong with it? Thanks!
@rragan I have made more test, it seems that dust-helper
doesn't work.
I have required it and included dust-helper.js in my .dust too. Anything I missed?
I would guess that for some reason dustjs-helpers is either not loaded or is loaded before dust. In the latter case, dust.helpers will be wiped out in dust initialization.
Thanks, I got it!
data:
usage:
I'm confused by this, I have readed this doc, but it doesn't show how to compare string : https://github.com/linkedin/dustjs/wiki/Dust-Tutorial#Helpers.
Could anybody tell me how to do that? Thanks!