UNPKG

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

27 lines (23 loc) 673 B
import toUser from 'ui/parse_query/lib/to_user'; import ParseQueryLibFromUserProvider from 'ui/parse_query/lib/from_user'; import uiModules from 'ui/modules'; uiModules .get('kibana') .directive('parseQuery', function (Private) { let fromUser = Private(ParseQueryLibFromUserProvider); return { restrict: 'A', require: 'ngModel', scope: { 'ngModel': '=' }, link: function ($scope, elem, attr, ngModel) { let init = function () { $scope.ngModel = fromUser($scope.ngModel); }; ngModel.$parsers.push(fromUser); ngModel.$formatters.push(toUser); init(); } }; });