How can i use if / else in hogan. I have following code. Status it is enum, which has two value("locked", "unlocked").I need to check, if status=="locked" then used class="label label-danger" , else class="label label-success". The problem in the syntax, how to do it.
template: [
'<p class="repo-language"><span class="glyphicon glyphicon-user">' +
'</span> <strong>{{fullName}}</strong><span class="pull-right label label-danger">{{status}}</span></p>',
'<p class="repo-name"><small>{{login}} / {{email}}</small></p>'
].join(''),
engine: Hogan
I don't know if it's a good practice, but functions are evaluated, I'm doing conditions like that:
http://jsfiddle.net/WL4QC/