For this particular line of code, I am getting an error that: Object is null or undefined.
private modalService: BsModalService
const modalRef = this.modalService.show(ABStationDialogComponent);
modalRef.content.presetStations = this.allStations;
modalRef.content.editStation = JSON.parse(JSON.stringify(this.editStation)); // Deep copy
modalRef.content.relatedFrom = this.editAbEntry.fromDate ? this.editAbEntry.fromDate : '';
modalRef.content.relatedTo = this.editAbEntry.toDate ? this.editAbEntry.toDate : '';
modalRef.content.editStations = this.editStations;
modalRef.content.pageReady = true;
I tried to use Optional Chaining but did not help. then I am getting this error:
The left-hand side of an assignment expression may not be an optional property access.
Please look at the image and the error.
Even tried to wrap up with if statement did not help as well. I am getting this error in my angular app after installing webpack 5.
can someone please help me to solve this issue?