Skip to content

Instantly share code, notes, and snippets.

@andreychev
Created March 21, 2014 11:14
Show Gist options
  • Save andreychev/9684041 to your computer and use it in GitHub Desktop.
Save andreychev/9684041 to your computer and use it in GitHub Desktop.
typeheadOpenOnFocus
// расширяет функционал стандартного typeahead - вызывает запрос по фокусу в инпут
.directive('typeaheadOpenOnFocus', function() {
return {
require: ['ngModel'],
link: function(scope, element, attr, ctrls) {
element.bind('click', function () {
ctrls[0].$setViewValue(element.val() || ' ');
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment