4
votes

I'm adding Knockout to specific section of a large application. Other parts make use of jQuery Templates (and it's embeded in a base JS file), so it's on the global jQuery object and I cannot remove it.

I'm running into the following error message when I use a foreach binding in a template:

This template engine does not support the 'foreach' binding within its templates 

It seems this is a problem when using the jQuery Template engine with Knockout. Is there any way to make Knockout use its default template engine rather than jQuery Templates?

1

1 Answers

13
votes

You can use ko.setTemplateEngine(new ko.nativeTemplateEngine()); before calling ko.applyBindings.