Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View compiled.js
1 2 3 4 5 6 7
var engine = new Eljs({
, helpers: {
strong: function(value){/*...*/}
}
});
engine.compile("<div>${user.address.length > 0} - ${strong(user.name)}</div>")
engine.parse(json);
View compiled.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
var engine = new Eljs({
template: "<div>${user.address.length > 0} - ${strong(user.name)}</div>"
, json : {
"user": {
name: "Christiano Milfont",
address: [{
country: "Brazil"
}]
}
}
, helpers: {
strong: function(value){return "<b>${value}</b>".interpolate({value:value})}
}
});
engine.parse()
View compiled.js
1 2 3 4 5 6 7 8 9 10 11 12
var engine;
$.get("template.html", function(markup){
engine = new Eljs({
helpers: {
strong: function(value){/*...*/}
}
});
engine.compile(markup);
})
 
//...
engine.parse(json);
View compiled.js
1 2 3 4 5 6 7 8 9 10 11 12
var engine;
$.get("template.html", function(markup){
engine = new Eljs({
template: markup,
helpers: {
strong: function(value){/*...*/}
}
});
})
 
//...
engine.parse(json);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.