How do I access the KnockOut ViewModel variables in the Chrome console now that I am using RequireJS?
Before using RequireJS, I followed a namespacing pattern, hiding everything within a single global. I could access the global by typing the following into the Chrome console: window.namespaceVar.
But now that I am using RequireJS, all my variables are hidden behind the require function.
require(['knockout-2.2.0', 'jquery'], function (ko, jQuery) {
var ViewModel = function () {
var testVar = ko.observable(true);
};
ko.applyBindings(new ViewModel());
}
So how would I access the current value of testVar
in the example?