btford / angular-modal

Simple AngularJS service for creating modals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

majgis opened this issue · 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.

What version of angular are you using? You may want to have a look at issue #26

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)