angular-modal icon indicating copy to clipboard operation
angular-modal copied to clipboard

v0.5.0 - TypeError: Cannot read property 'then' of undefined

Open majgis opened this issue 9 years ago • 2 comments

I'm getting this error when calling deactivate (subsequent calls to activate fail):

 TypeError: Cannot read property 'then' of undefined

on this line: https://github.com/btford/angular-modal/blob/master/modal.js#L75

I rolled back to v0.4.0 and there is no error.

majgis avatar Apr 17 '15 16:04 majgis

What version of angular are you using? You may want to have a look at issue https://github.com/btford/angular-modal/issues/26

ryanhart2 avatar Apr 18 '15 05:04 ryanhart2

Yes, I am using Angular 1.2 and I am not able to upgrade.

The following works as a fix, if I did a PR would you accept?

function callback (){...}
var promise = $animate.leave(element, callback)
if (promise) 
    promise.then(callback)

majgis avatar Apr 18 '15 22:04 majgis