I'v applied binding only once, but still getting error
You cannot apply bindings multiple times to the same element.
This is my script.
<script>
var self = this;
var vm = function viewModel() {
self.getAppointment = function () {
$("#dialog-confirm ").dialog({
resizable: false,
height: 250,
width: 500,
modal: true
});
self.checkAppointmentListSelect(true);
}
self.checkAppointmentListSelect = ko.observable(false);
self.btnSelectAppointmentClick = function () {
self.checkAppointmentListSelect(true);
}
debugger;
}
ko.applyBindings(vm);
</script>
This is the html data
<div id="dialog-confirm" title="Select Appointment">
<div class="modal-body" data-bind="visible: checkAppointmentListSelect">
<button class="btn btn-primary" id="btnSelectAppointment" data-bind="click: btnSelectAppointmentClick">Select</button>
<button class="btn btn-primary" id="btnCancel">Cancel</button>
</div>
<div class="modal-body" data-bind="visible: checkAppointmentListSelect">
<button class="btn btn-primary" id="btnSelectAppointment">Select </button>
<button class="btn btn-primary" id="btnCancel">Cancel</button>
</div>
</div>