javascript - Knockout and applybindings - what is going on here? -


i have this:

socket.bind('todaytutors', function (data) {             tuts.push(data);             ko.applybindings(tuts);         }); 

now, bind receives data every 30 seconds. pushing data observable array, , want data rendered. now, not work, why? if put breakpoint right before ko.applybindings(tuts); data rendered, , when let breakpoint free, render removed. tried this, hoping .push() automatically update views:

ko.applybindings(tuts); socket.bind('todaytutors', function (data) {                 tuts.push(data);             }); 

but doesn't want work either. doing wrong?

it seems ko.applybindings(); somehow manipulating flow of application, solved problem doing this:

{    ko.applybindings(tuts); } socket.bind('todaytutors', function (data) {                 tuts.push(data);             }); 

Comments