kibana-123
Version:
Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic
22 lines (18 loc) • 501 B
JavaScript
import uiModules from 'ui/modules';
uiModules
.get('kibana')
.directive('validateLowercase', function () {
return {
restrict: 'A',
require: 'ngModel',
link: function ($scope, elem, attr, ctrl) {
ctrl.$validators.lowercase = function (modelValue, viewValue) {
if (ctrl.$isEmpty(modelValue)) {
// consider empty models to be valid per lowercase rules
return true;
}
return viewValue.toLowerCase() === viewValue;
};
}
};
});