annotations_query_ctrl.ts 695 B

1234567891011121314151617181920212223
  1. import { react2AngularDirective } from 'app/core/utils/react2angular';
  2. import { AnnotationQueryEditor } from './components/AnnotationQueryEditor';
  3. export class StackdriverAnnotationsQueryCtrl {
  4. static templateUrl = 'partials/annotations.editor.html';
  5. annotation: any;
  6. constructor() {
  7. this.annotation.target = this.annotation.target || {};
  8. this.onQueryChange = this.onQueryChange.bind(this);
  9. react2AngularDirective('annotationQueryEditor', AnnotationQueryEditor, [
  10. 'target',
  11. 'onQueryChange',
  12. 'onExecuteQuery',
  13. ['datasource', { watchDepth: 'reference' }],
  14. ]);
  15. }
  16. onQueryChange(target) {
  17. Object.assign(this.annotation.target, target);
  18. }
  19. }