knockout.js - Knockout script not hitting applyBindings -


i have simple screen utilizing knockout script. have odd issue.

i have qa/staging/production environments set up, , screen loads , runs locally , in qa environment. however, when migrate scripts , page staging server, knockout doesn't hit ko.applybinding(vm) code. on qa server. using chrome debugger tool break @ point verify.

here code, less functions...

$(document).ready(function () { vm = new function () {          var thisvm = this;          this.lastname = ko.observable(),         this.firstname = ko.observable(),         this.dob = ko.observable(),         this.citylist = ko.observable([])          //load citylist         this.loadcitylist = function (callback) {             var data = {};             new ajaxjsonhelper().invoke("servicedelivery.aspx/getcitylist", data, vm.loadcitylistcallback, showajaxfailure, false);         }          this.loadcitylistcallback = function (result) {             if (result.d != null) {                vm.citylist(result.d);             }         }     }     ko.applybindings(vm);  }); 

i believe there's few things @ play here. , i've created jsfiddle demonstrate concepts working.

note: i've removed inner code clarity sake.

var vm = function() {   var thisvm = this;    console.log("inside view model"); };  $(document).ready(function() {       ko.applybindings(new vm()); }); 

Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -