query_editor.ts 705 B

1234567891011121314151617181920212223242526
  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. watch: "datasource.type",
  11. directive: scope => {
  12. console.log(scope.datasource);
  13. return System.import(scope.datasource.meta.module).then(function(dsModule) {
  14. return {
  15. name: 'annotation-query-editor-' + scope.datasource.meta.id,
  16. fn: dsModule.annotationsQueryEditor,
  17. };
  18. });
  19. },
  20. });
  21. }
  22. angular.module('grafana.directives').directive('annotationsQueryEditor', annotationsQueryEditor);