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 ev
As Ryan suggested, the quickest way is to use ko.contextFor
and ko.dataFor
in the console to see the binding context of an element on the dom.
There's also a very useful Chrome Extension that uses this principle called KnockoutJS Context Debugger, available here:
Chrome Web Store - KnockoutJS Context Debugger
It allows you to inspect an element and see it's context in the sidebar of the elements pane. It's most useful it you have multiple binding contexts on a page, or very nested binding contexts.