Uncaught TypeError: Cannot read property '$destroy' of undefined - angular-loading-overlay.js:98
Hello
Using an overlay in a modal, when I close the modal, I get this error in the console.
Changing this segment (near line 98)
$element.on('$destroy', function () { overlayElementScope.$destroy(); unsubscribe(); });
To
$element.on('$destroy', function () { if (overlayElementScope){ overlayElementScope.$destroy(); } unsubscribe(); });
Corrects the problem.
Hello! Thank you for reporting the issue.
Could you specify what modal you are using?
I am using mgcrea.ngStrap.modal.
I m also having this problem and it gets solved by adding the if clause like so:
https://github.com/superosku/angular-loading-overlay/commit/62887d3ef363ecd98ed71e7443a050e00e01dde4
Unfortunetly I m not familiar with the codebase so much that I could understand the cause of this so I cant add tests and make a pr
@bsalex Any updates on this?