Hi my question is specific to libraries/plugins that depend on knockout.
Currently, I'm implementing requirejs in my existing project, a multi-page app.
This is what I currently have,
my common.js
require.config({
baseUrl: '/Scripts/',
paths: {
ko: '/Scripts/lib/knockout-3.3.0',
jquery: '/Scripts/jquery-1.10.2',
domReady: '/Scripts/lib/domReady'
}
});
file1.js
define(['ko', 'jquery'], function(ko, $){
// code goes here
});
Above worked perfectly, until I need to use the knockoutjs-mapping (that I downloaded via nuget) plugin for knockout.
How will I include the knockoutjs-mapping in my project and make sure knockoutjs was loaded first before this or any 3rd party library. And how can I use it?
I tried something like this:
define(['ko', 'jquery', 'mapping'], function(ko, $, mapping) {
});
But not working,
And I saw this link but can't seem to figure out how to implement it. Any help would be much appreciated. Thanks