knockout.js - javascript - knockout - how it works? -
i trying utilize knockout , wonder myself how works network point of view : can see "calls" browser client server retrieve data? mean : used utilize ajax calls populate forms, tables... => can see ajax calls server. same thing when need submit form : can see ajax calls. means can debug firefbug , see parameters sent/ response received, inluding headers (request/response). knocknout, info in form "binding" automatically framework ko. so, know how works really? how calls done? there way "see" info flow?
from network point of view, nil changes when using knockout. you'll still need create ajax calls populate view models, they're outside framework, not part of it. means can still set breakpoint on ajax calls , observe stuff beingness sent , received.
a major code departure network calls exist within knockout viewmodel.
var somevm = function(data) { var self = this; self.id = ko.observable(data.id); // ... self.getitems = function() { // ajax phone call here, method on vm } }
however, tj crowder points out - key mechanic of knockout binding client side view model user interface, either info population or visibility command in single page application. networking you'll have handle, it's not part of knockout. likely, you'll create little changes in placement of ajax calls.
javascript knockout.js
No comments:
Post a Comment