我正试图用requireJS将此示例转换为AMD。
作为一个例子,我选择了"基本窗口"小部件:
<base-window params="title: 'Window title'">
<h1 data-bind="text: title"></h1>
<p>This is a body of the window</p>
</base-window>
请参阅plunk。
但是,没有显示窗口的主体。浏览器显示:
Uncaught ReferenceError: Unable to process binding "template: function (){return {nodes:$componentTemplateNodes} }"
Message: $componentTemplateNodes is not defined
有人能说出怎么了吗?
上下文变量$componentTemplateNodes
仅从KO 3.3版开始可用
Plunk