A couple things that should help clear this up:
- If you reference jquery.tmpl.js before Knockout.js, then KO will set the jQueryTmplTemplateEngine as the default.
- The jQueryTmplTemplateEngine does not support anonymous templates. This means that you can't use the control-flow bindings like
foreach, if, ifnot, and with within it. You can still use the template binding (including nested templates).
- You can control the default template engine by calling
ko.setTemplateEngine(). You would pass an instance of the engine that you want to use like ko.setTemplateEngine(new ko.nativeTemplateEngine)
- You can also pass the template engine to the template binding in the
templateEngine parameter.
So, for your case, you would likely want to remove the reference to jquery.tmpl.js, so that the native template engine is being used by default. The native template engine does support nested templates (anonymous or named).
Quick sample showing a named template with anonymous templates inside of it using the native template engine: http://jsfiddle.net/rniemeyer/GXFYB/