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

32 lines (25 loc) 688 B
import uiModules from 'ui/modules'; uiModules .get('kibana') .directive('renderCounter', () => ({ controller($scope, $element) { let counter = 0; const increment = () => { counter += 1; $element.attr('render-counter', counter); }; const teardown = () => { $element.off('renderComplete', increment); }; const setup = () => { $element.attr('render-counter', counter); $element.on('renderComplete', increment); $scope.$on('$destroy', teardown); }; this.disable = () => { $element.attr('render-counter', 'disabled'); teardown(); }; setup(); } }));