angular-loading-overlay icon indicating copy to clipboard operation
angular-loading-overlay copied to clipboard

Uncaught TypeError: Cannot read property '$destroy' of undefined - angular-loading-overlay.js:98

Open pouletfou opened this issue 9 years ago • 4 comments

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.

pouletfou avatar Aug 19 '16 18:08 pouletfou

Hello! Thank you for reporting the issue.

Could you specify what modal you are using?

bsalex avatar Aug 21 '16 11:08 bsalex

I am using mgcrea.ngStrap.modal.

pouletfou avatar Aug 29 '16 20:08 pouletfou

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

superosku avatar Sep 01 '16 09:09 superosku

@bsalex Any updates on this?

pouletfou avatar Oct 11 '16 20:10 pouletfou