Skip to content

Instantly share code, notes, and snippets.

View AlexShkor's full-sized avatar

Alex Shkor AlexShkor

View GitHub Profile
@dkotov
dkotov / index.html
Last active December 15, 2015 09:19
Twitter Bootstrap Typeahead wrapper that uses objects instead of strings (lite version) -- see example http://jsfiddle.net/VjVMf/.
<input type="text" data-bind="value: customerAC.query, jqueryui: { widget: 'typeahead', options: { source: customerAC.source } }" placeholder="Start typing customer name..." />
<br />
<strong data-bind="text: selectedCustomerId"></strong>
@hyle
hyle / ko.utils.signatures.js
Last active May 14, 2022 21:15
KnockoutJS utils (ko.utils) signatures
// knockout 2.2.1
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
ko.utils.arrayForEach = function (array, action) { /* .. */ }
ko.utils.arrayGetDistinctValues = function (array) { /* .. */ }