Skip to content

Instantly share code, notes, and snippets.

@IcodeNet
Created January 21, 2014 07:53
Show Gist options
  • Save IcodeNet/8535918 to your computer and use it in GitHub Desktop.
Save IcodeNet/8535918 to your computer and use it in GitHub Desktop.
twitter Type ahead Binding handler
ko.bindingHandlers.typeahead = {
init: function (element, valueAccessor) {
var observableSource = valueAccessor();
var elem = $(element)[0];
var options = {
source: ko.utils.unwrapObservable(observableSource),
items : 4
};
elem.typeahead(options);
},
update: function () {
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment