I have an input input element like this
<input id="txtId" type="text" data-bind="value: query, valueUpdate: 'keyup'">
and I also have a collection that links to this entry
<script> var terms = [{name: blah,...,... }]; var viewModel = { query: ko.observable('') }; viewModel.terms = ko.dependentObservable(function () { var search = this.query().toLowerCase(); return ko.utils.arrayFilter(terms, function (term) { return term.name.toLowerCase().indexOf(search) >= 0; }); }, viewModel); ko.applyBindings(viewModel); </script>
I want to select the available elements, and they should appear in my input element. But the binding of an item to a collection and collection begins to change. I need to somehow break the bindings. So please help)
source share