panel_editor_tab.ts 679 B

12345678910111213141516171819202122232425262728
  1. ///<reference path="../../headers/common.d.ts" />
  2. import angular from 'angular';
  3. import config from 'app/core/config';
  4. var directiveModule = angular.module('grafana.directives');
  5. /** @ngInject */
  6. function panelEditorTab(dynamicDirectiveSrv) {
  7. return dynamicDirectiveSrv.create({
  8. scope: {
  9. ctrl: "=",
  10. editorTab: "=",
  11. index: "=",
  12. },
  13. directive: scope => {
  14. var pluginId = scope.ctrl.pluginId;
  15. var tabIndex = scope.index;
  16. return Promise.resolve({
  17. name: `panel-editor-tab-${pluginId}${tabIndex}`,
  18. fn: scope.editorTab.directiveFn,
  19. });
  20. }
  21. });
  22. }
  23. directiveModule.directive('panelEditorTab', panelEditorTab);