Great way to debug in Knockout

http://www.knockmeout.net/2011/06/10-things-to-know-about-knockoutjs-on.html

https://groups.google.com/forum/?fromgroups=#!topic/knockoutjs/nTLoWIE97mE

<div data-bind=”text: ko.toJSON(viewModel.interestingPart)”></div>

<span data-bind=”visible: console.log($data) “></span>

<pre data-bind=”text: ko.toJSON($data, null, 2)”></pre>

console.group(“Dumping view model”); 
console.dir(ko.toJS(viewModel)); 
console.groupEnd(); 

Leave a Reply