Sha256: f253d233cc6966f90963dac84d89a40e2c0c38e37bbbd014da3eab35f05b58c4
Contents?: true
Size: 846 Bytes
Versions: 234
Compression:
Stored size: 846 Bytes
Contents
/** * @ngdoc directive * @name Bastion.components.directive:typeaheadEmpty * * * @description * Used to support autocompletion on focus, not just after the user types a single character * * @example <input typeahead="item as item.label for item in table.autocomplete($viewValue)" typeahead-empty /> */ angular.module('Bastion.components').directive('typeaheadEmpty', function () { return { require: 'ngModel', link: function (scope, element, attrs, modelCtrl) { element.bind('focus', function () { if (angular.isUndefined(modelCtrl.$viewValue) || modelCtrl.$viewValue === '') { modelCtrl.$setViewValue(' '); } else { modelCtrl.$setViewValue(modelCtrl.$viewValue); } }); } }; });
Version data entries
234 entries across 234 versions & 2 rubygems