How would we register these two JavaScript helpers in Handlebars.Net?
For Moment.js:
Handlebars.registerHelper("formatDate", function (datetime, format) {
return moment(datetime).format(format);
});
For a java script calculation:
Handlebars.registerHelper("formatPercent", function (val1, limit) {
return Math.ceil(100 * val1 / limit);
});m
Aucun commentaire:
Enregistrer un commentaire