What is the standard way of loading mapping plugin in require.js ?
Below is my config.js (require.js config file)
require.config({
// Initialize the application with the main application file.
deps: ["app"],
paths:{
// JavaScript folders.
libs: "lib",
plugins: "lib/plugin",
templates: "../templates",
// Libraries.
jquery: "lib/jquery-1.7.2.min",
underscore: "lib/lodash",
text: 'text',
order: 'order',
knockout: "lib/knockout",
knockoutmapping: "lib/plugin/knockout-mapping"
},
shim:{
underscore:{
exports: '_'
},
knockout:{
deps: ["jquery"],
exports: "knockout"
}
}
}
In my view model
define(['knockout', 'knockoutmapping'], function(ko, mapping) {
}
However, mapping is not bound to ko.mapping. Any pointers/suggestions would be appreciated.
Thanks,
Ravi
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…