Knockout.js mapping plugin with require.js
Posted
by
Ravi
on Stack Overflow
See other posts from Stack Overflow
or by Ravi
Published on 2012-06-25T21:34:37Z
Indexed on
2012/07/07
21:16 UTC
Read the original article
Hit count: 959
knockout.js
|knockout-mapping-plugin
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
© Stack Overflow or respective owner