Commit 79a803ea by Torkel Ödegaard

feat(ds observable): minor progress on handling data source observable

parent 0f657980
...@@ -27,6 +27,7 @@ class MetricsPanelCtrl extends PanelCtrl { ...@@ -27,6 +27,7 @@ class MetricsPanelCtrl extends PanelCtrl {
skipDataOnInit: boolean; skipDataOnInit: boolean;
datasources: any[]; datasources: any[];
dataSubscription: any; dataSubscription: any;
dataHandler: any;
constructor($scope, $injector) { constructor($scope, $injector) {
super($scope, $injector); super($scope, $injector);
...@@ -203,7 +204,10 @@ class MetricsPanelCtrl extends PanelCtrl { ...@@ -203,7 +204,10 @@ class MetricsPanelCtrl extends PanelCtrl {
handleObservable(observable) { handleObservable(observable) {
this.dataSubscription = observable.subscribe({ this.dataSubscription = observable.subscribe({
next: (data) => { next: (data) => {
console.log('panel: observer got data'); if (data.range) {
this.range = data.range;
}
this.dataHandler(data);
}, },
error: (error) => { error: (error) => {
console.log('panel: observer got error'); console.log('panel: observer got error');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment