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.
FYI: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屋!