Closed xdamman closed 13 years ago
All of the conditional logic goes into your javascript file, with weld you can use map functions. This is a contrived example obviously, but it demonstrates how...
window.weld($('.people')[0], {
person: [
{
name: 'John',
job: [
'guru', 'monkey', 'tester'
]
},
{
name: 'Bob',
job: [
'supervise', 'yell'
]
}
]
},
{
map: function(el, key, value) {
if(key==='name' && value==='John') {
return $(el).addClass('edgeCase');
}
}
});
This projects looks very interesting. I've always found templating systems to be bad hacks.
The question is how do you do conditions (if else)? Eg. (in ejs) <% if(person.description) { %>
<% } %>
Thanks!