in web-app-demo/Frontend/src/app/components/processor-selection/processor-selection.component.ts [73:115]
async ngOnInit(): Promise<void> {
this.url = location.href.split("-");
this.url.splice(0, 3);
this.backend = "https://backend-" + this.url.join("-");
await fetch(this.backend + "api/init", {
method: "GET",
mode: "cors",
})
.then(async (response) => {
const json = await response.json();
if (json["resultStatus"] == "ERROR") {
throw new Error(json.errorMessage);
}
})
.catch((error) => {
this.data.changeShowError(true);
this.data.changeErrorMessage(error);
});
this.getAvailableProcessors();
this.subscription = this.data.processor.subscribe(
(message) => (this.processor = message)
);
this.subscription = this.data.fileName.subscribe(
(message) => (this.fileName = message)
);
this.subscription = this.data.file.subscribe(
(message) => (this.file = message)
);
this.subscription = this.data.showBounding.subscribe(
(message) => (this.showBounding = message)
);
this.subscription = this.data.documentProto.subscribe(
(message) => (this.documentProto = message)
);
this.subscription = this.data.processingIsDone.subscribe(
(message) => (this.processIsDone = message)
);
this.subscription = this.data.showError.subscribe(
(message) => (this.showError = message)
);
}