Skip to content

Commit

Permalink
fix: TypeError: Cannot read property 'timeSrv' of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
jonyrock committed Feb 8, 2019
1 parent 5662202 commit 8da6221
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000/d/Votr2gvmk/nginx",
"url": "http://localhost:3000/",
"sourceMaps": true,
"pathMapping": {
"/public/plugins/hastic-graph-panel": "${workspaceFolder}/dist"
Expand Down
6 changes: 4 additions & 2 deletions src/panel/graph_panel/graph_renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export class GraphRenderer {
private timeSrv: any;
private _graphMousePosition: any;

constructor ($elem: JQuery<HTMLElement>, timeSrv, contextSrv, scope) {
constructor($elem: JQuery<HTMLElement>, timeSrv, contextSrv, scope) {



var self = this;
this.$elem = $elem;
Expand Down Expand Up @@ -164,7 +166,7 @@ export class GraphRenderer {
// this.eventManager.updateTime(selectionEvent.xaxis);
// }, 100);
} else {
this.scope.$apply(function() {
this.scope.$apply(() => {
this.timeSrv.setTime({
from: moment.utc(selectionEvent.xaxis.from),
to: moment.utc(selectionEvent.xaxis.to),
Expand Down

0 comments on commit 8da6221

Please sign in to comment.