I am creating an ASP.NET single-page application, and have a require.js config file that runs on application start, referencing jQuery, Sammy.js, and knockout.js. I have created shims for the three third-party libraries to allow me to access them on a global level:
require.config({
paths: {
"jquery": "/Scripts/jquery-2.1.4.min",
"sammy": "/Scripts/sammy-0.7.5.min",
"knockout": "/Scripts/knockout-3.3.0",
"text": "/Scripts/text",
"appVm": "/Scripts/app/appViewModel"
},
shim: {
"jquery": {
exports: "$"
},
"sammy": {
deps: ["jquery"],
exports: "Sammy"
},
"knockout": {
deps: ["jquery"],
exports: "ko"
}
},
priority: ["text", "app"],
});
define(["knockout", "appVm", "sammy"], function(ko, appVm, sammy) {
var vm = new appVm();
ko.applyBindings(vm);
var app = sammy(function() {
this.get("#Dashboard", function() {
//Dashboard-related logic here
});
});
app.run("#Dashboard");
});
I am able to instantiate my knockout viewmodel and bind it to the page. However, when I try to access the global variable "ko" for knockout to debug in the Chrome Developer console, nothing is defined.
How can I obtain the "ko" object for debugging in Chrome?