ko.mapping is undefined

kekewong picture kekewong · Feb 7, 2012 · Viewed 11k times · Source

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 : The knockout.js version is 2.0 and Jquery 1.7.1

Answer

James Allardice picture James Allardice · Feb 7, 2012

As the mapping plugin is exactly that, a plugin, it is not included in the core library.

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.