I'v 한 번만 바인딩 적용 Knockout.Js에서 같은 요소에 바인딩을 여러 번 적용,하지만 여전히 점점 수없는 경우, 동일한 요소에 바인딩을 여러 번 적용 할 수 없습니다당신은
오류입니다.
이것은 내 스크립트입니다.
<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>
이
은 몇 가지주의 할 HTML 데이터<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>
이 코드는 잘 동작하고 있으며보기의 코드 샘플을 추가 할 수 있습니까? ko.applyBindings라고 부르는 장소가 더 많습니까? –
knockout이 해당 페이지에서 사용중인 _only_ 장소입니까? 아니면 두 개의 다른 영역에서 두 번 사용하고 있습니까? –
아니요,이 페이지에서만 –