KO Js Using in jsp with two objects
KO JS using for iterate a JSON object in JSP When Jsp file loads in that time the two JSO objects reads and convert as a ko object $(document) .ready( function() { var payOptJson = "${paymentOpt}"; var payOptJsonreplace = payOptJson.replace(/'/g, '"'); var payOptJsonKo = ko.observableArray(JSON .parse(payOptJsonreplace)); var paybanksJson = '${paybanks}'; var paybanksJsonreplace = paybanksJson.replace(/'/g, '"'); var paybanksJsonKo = ko.observableArray(JSON .parse(paybanksJsonreplace)); var policydetailsArray; function AppViewModel() { var self = this; self.payOpt = payOptJsonKo; self.paybanks = paybanksJsonKo; } ko.applyBindings(new AppViewModel()); }); iterate the Ko objects in JSP Using KO js <div class="col-md-10 col-sm-10" data-bind="foreach:payOpt"> ...