ko.mapping 未定义 [英] ko.mapping is undefined
问题描述
我正在关注这个例子 http://jsfiddle.net/rniemeyer/badZb/ .我只是将确切的代码复制并粘贴到示例应用程序中,它给了我这个错误:ko.mapping is undefined".有谁知道发生了什么?我的 ko.observable 和dependentObservable 运行良好,只是 ko.mapping 不起作用.
im following this example http://jsfiddle.net/rniemeyer/badZb/ . I just copy and paste the exact code into a sample application and it gave me this error : "ko.mapping is undefined" . Anyone know whats happening? My ko.observable and dependentObservable are working great, is just that ko.mapping is not working.
仅供参考:knockout.js 版本是 2.0 和 Jquery 1.7.1
FYI : The knockout.js version is 2.0 and Jquery 1.7.1
推荐答案
由于映射插件就是一个插件,所以它不包含在核心库中.
As the mapping plugin is exactly that, a plugin, it is not included in the core library.
您需要单独包含映射插件.您可以在 GitHub 上找到它.只要确保在包含核心 Knockout 库之后包含它.
You need to include the mapping plugin separately. You can find it on GitHub. Just make sure you include it after including the core Knockout library.
这篇关于ko.mapping 未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!