Smiling Bald Guy

Solving the world's problems using code (that honestly could use a few more unit tests).

Archive for the ‘KnockoutJS’ Category

Stupid KnockoutJS tricks #1

leave a comment »

Here’s the first in what I hope to become a long list of tips and tricks for using (and debugging) KnockoutJS:

If you want to see the state of the viewmodel that you have bound to a node in your DOM, use the following call:

ko.utils.domData.getAll($('#<<node ID>>')[0]).__ko_bindingContext__.$root

Written by Andy Hopper

March 22, 2012 at 9:35 am

Posted in Debugging, KnockoutJS