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

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

php - HTTP_REFERER woes: How can I allow access to a specific page, only when a visitor has visited another specific page beforehand? -