I am developing SPA in KnockoutJS, and facing an issue in rendering external templates in KnockoutJS.
I am using External Template Engine by Jim Cowart.
https://github.com/ifandelse/Knockout.js-External-Template-Engine
This binding :
<div data-bind='template: {name: 'template1', templateUrl:"/dynamicviewtemplate"}'></div>
works. While this one :
<div data-bind='template: {name: templateName, templateUrl:"/dynamicviewtemplate"}'></div>
does not work.
Template does not load based on the observable.
The
templatebinding does not automatically unwrap thenamefield. You can fix this by specifying your binding like: