From ec4631e65c97b3cba853b7c5684ec040b8026372 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Sun, 9 Oct 2022 17:00:54 +0200 Subject: [PATCH] replace deprecated api --- .../visualization-page.component.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pdb-js/src/app/visualization-page/visualization-page.component.ts b/pdb-js/src/app/visualization-page/visualization-page.component.ts index 04d293f..d15a678 100644 --- a/pdb-js/src/app/visualization-page/visualization-page.component.ts +++ b/pdb-js/src/app/visualization-page/visualization-page.component.ts @@ -144,17 +144,18 @@ export class VisualizationPageComponent implements OnInit { const request = this.createPlotRequest(); - this.plotService.sendPlotRequest(request).subscribe(function(plotResponse: PlotResponse){ - console.log("response: " + JSON.stringify(plotResponse)); - that.plotView.imageUrl = "http://"+window.location.hostname+':'+window.location.port+'/'+plotResponse.imageUrl; - that.plotView.stats = plotResponse.stats; - document.dispatchEvent(new Event("invadersPause", {})); - }, - (error:any) => { - that.plotView.imageUrl = ''; - that.plotView.stats = null; - that.showError(error.error.message); - document.dispatchEvent(new Event("invadersPause", {})); + this.plotService.sendPlotRequest(request).subscribe({ + next: (plotResponse: PlotResponse) => { + this.plotView.imageUrl = "http://"+window.location.hostname+':'+window.location.port+'/'+plotResponse.imageUrl; + this.plotView.stats = plotResponse.stats; + document.dispatchEvent(new Event("invadersPause", {})); + }, + error: (error:any) => { + this.plotView.imageUrl = ''; + this.plotView.stats = null; + this.showError(error.error.message); + document.dispatchEvent(new Event("invadersPause", {})); + } }); }