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();
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;
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:any) => {
that.plotView.imageUrl = '';
that.plotView.stats = null;
that.showError(error.error.message);
error: (error:any) => {
this.plotView.imageUrl = '';
this.plotView.stats = null;
this.showError(error.error.message);
document.dispatchEvent(new Event("invadersPause", {}));
}
});
}