【发布时间】:2013-01-18 02:18:47
【问题描述】:
我正在使用 KnockoutJS 开发 SPA,并在 KnockoutJS 中呈现外部模板时遇到问题。
我正在使用 Jim Cowart 的 External Template Engine。 https://github.com/ifandelse/Knockout.js-External-Template-Engine
这个绑定:
<div data-bind='template: {name: 'template1', templateUrl:"/dynamicviewtemplate"}'></div>
有效。而这个:
<div data-bind='template: {name: templateName, templateUrl:"/dynamicviewtemplate"}'></div>
不工作。
模板不会根据 observable 加载。
【问题讨论】:
标签: knockout.js template-engine