mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Handle strings in source mapped as numbers (#14318)
This commit is contained in:
parent
1ef7db6f10
commit
72a2af85e9
3 changed files with 15 additions and 0 deletions
13
src/ui/public/directives/string_to_number.js
Normal file
13
src/ui/public/directives/string_to_number.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('kibana');
|
||||
|
||||
module.directive('stringToNumber', function () {
|
||||
return {
|
||||
require: 'ngModel',
|
||||
link: function (scope, element, attrs, ngModel) {
|
||||
ngModel.$formatters.push((value) => {
|
||||
return parseFloat(value);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
|
@ -12,6 +12,7 @@
|
|||
/>
|
||||
<input
|
||||
ng-switch-when="number"
|
||||
string-to-number
|
||||
type="number"
|
||||
placeholder="{{placeholder}}"
|
||||
step="any"
|
||||
|
|
|
@ -2,6 +2,7 @@ import { uiModules } from 'ui/modules';
|
|||
import template from './filter_params_input_type.html';
|
||||
import '../../directives/validate_date_math';
|
||||
import '../../directives/validate_ip';
|
||||
import '../../directives/string_to_number';
|
||||
|
||||
const module = uiModules.get('kibana');
|
||||
module.directive('filterParamsInputType', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue