Skip to content
Browse files

Set the templateEngine option during rendering

The templateEngine field of parameter option is evaluated during
template rendering, but it's never set. This change allow to
specify the templateEngine to use.
  • Loading branch information...
1 parent 7c37401 commit ed83405bd181be1e811cdb1531e94f7e700b769a Luciano Barcellos committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/templating/templating.js
View
4 src/templating/templating.js
@@ -113,12 +113,12 @@
var templateSubscription;
if (typeof bindingValue['foreach'] != "undefined") {
// Render once for each data point
- templateSubscription = ko.renderTemplateForEach(templateName, bindingValue['foreach'] || [], { 'templateOptions': bindingValue['templateOptions'], 'afterAdd': bindingValue['afterAdd'], 'beforeRemove': bindingValue['beforeRemove'], 'includeDestroyed': bindingValue['includeDestroyed'], 'afterRender': bindingValue['afterRender'] }, element);
+ templateSubscription = ko.renderTemplateForEach(templateName, bindingValue['foreach'] || [], { 'templateOptions': bindingValue['templateOptions'], 'afterAdd': bindingValue['afterAdd'], 'beforeRemove': bindingValue['beforeRemove'], 'includeDestroyed': bindingValue['includeDestroyed'], 'afterRender': bindingValue['afterRender'], 'templateEngine': bindingValue['templateEngine'] }, element);
}
else {
// Render once for this single data point (or use the viewModel if no data was provided)
var templateData = bindingValue['data'];
- templateSubscription = ko.renderTemplate(templateName, typeof templateData == "undefined" ? viewModel : templateData, { 'templateOptions': bindingValue['templateOptions'], 'afterRender': bindingValue['afterRender'] }, element);
+ templateSubscription = ko.renderTemplate(templateName, typeof templateData == "undefined" ? viewModel : templateData, { 'templateOptions': bindingValue['templateOptions'], 'afterRender': bindingValue['afterRender'], 'templateEngine': bindingValue['templateEngine'] }, element);
}
// It only makes sense to have a single template subscription per element (otherwise which one should have its output displayed?)

0 comments on commit ed83405

Please sign in to comment.
Something went wrong with that request. Please try again.