query_editor.ts 678 B

12345678910111213141516171819202122232425
  1. ///<reference path="../../headers/common.d.ts" />
  2. import angular from 'angular';
  3. /** @ngInject */
  4. function annotationsQueryEditor(dynamicDirectiveSrv) {
  5. return dynamicDirectiveSrv.create({
  6. scope: {
  7. annotation: "=",
  8. datasource: "="
  9. },
  10. watchPath: "annotation.datasource",
  11. directive: scope => {
  12. return System.import(scope.datasource.meta.module).then(function(dsModule) {
  13. return {
  14. name: 'annotation-query-editor-' + scope.datasource.meta.id,
  15. fn: dsModule.annotationsQueryEditor,
  16. };
  17. });
  18. },
  19. });
  20. }
  21. angular.module('grafana.directives').directive('annotationsQueryEditor', annotationsQueryEditor);