Files
grafana/public/app/plugins/datasource/stackdriver/annotations_query_ctrl.ts
Erik Sundell 0c178f8623 cleanup
2019-01-03 16:21:20 +01:00

24 lines
707 B
TypeScript

import { react2AngularDirective } from 'app/core/utils/react2angular';
import { AnnotationQueryEditor } from './components/AnnotationQueryEditor';
export class StackdriverAnnotationsQueryCtrl {
static templateUrl = 'partials/annotations.editor.html';
annotation: any;
constructor() {
this.annotation.target = this.annotation.target || {};
this.handleQueryChange = this.handleQueryChange.bind(this);
react2AngularDirective('annotationQueryEditor', AnnotationQueryEditor, [
'target',
'onQueryChange',
'onExecuteQuery',
['datasource', { watchDepth: 'reference' }],
]);
}
handleQueryChange(target) {
Object.assign(this.annotation.target, target);
}
}