Closed sackIndian closed 10 years ago
The mustache docs may help. Specifically sections and inverted sections.
Hello @nemtsov, i am wondering wether is it possible to use switch cases with hogan.
You can take a look at my senario: [ {"type" : "1", "detail" : "my detail"}, {"type" : "2", "detail" : "my detail"}, {"type" : "2", "detail" : "my detail"}, ]
Here as mustache docs, i can do something like [{"type1" : true, ...} ], but with this each time i need to change my json key while constructing my json. It is little problematic for me.
@sackIndian mustache by its definition is a logic-less template. In practice that means only boolean logic. So, you can't check for a specific type, but can check for existence of a property. This is by design. Take a look at this SO question for the reasons.
Also, this discussion doesn't really belong in Hogan, as your question is about mustache in general, so you may want to close it and move it to Stack Overflow, if you're still not happy with the answer.
Thanks @nemtsov.
Hi, How can i achieve
if(v1 == "somestring") { }
this with hagan.js?
Thanks in advance.