replace deprecated api

This commit is contained in:
2022-10-09 17:00:54 +02:00
parent 981db04739
commit ec4631e65c

View File

@@ -144,17 +144,18 @@ export class VisualizationPageComponent implements OnInit {
const request = this.createPlotRequest(); const request = this.createPlotRequest();
this.plotService.sendPlotRequest(request).subscribe(function(plotResponse: PlotResponse){ this.plotService.sendPlotRequest(request).subscribe({
console.log("response: " + JSON.stringify(plotResponse)); next: (plotResponse: PlotResponse) => {
that.plotView.imageUrl = "http://"+window.location.hostname+':'+window.location.port+'/'+plotResponse.imageUrl; this.plotView.imageUrl = "http://"+window.location.hostname+':'+window.location.port+'/'+plotResponse.imageUrl;
that.plotView.stats = plotResponse.stats; this.plotView.stats = plotResponse.stats;
document.dispatchEvent(new Event("invadersPause", {})); document.dispatchEvent(new Event("invadersPause", {}));
}, },
(error:any) => { error: (error:any) => {
that.plotView.imageUrl = ''; this.plotView.imageUrl = '';
that.plotView.stats = null; this.plotView.stats = null;
that.showError(error.error.message); this.showError(error.error.message);
document.dispatchEvent(new Event("invadersPause", {})); document.dispatchEvent(new Event("invadersPause", {}));
}
}); });
} }