This repository has been archived by the owner on May 29, 2019. It is now read-only.
fix(modal): Modal Dialog doesn't fade out #3888
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixed the issue for me. I have tested it with Angular 1.4 and 1.3 and it seems to work for both.
It seems in Angular 1.4, the animation events are no longer triggered on elements, instead there are new functions on $animate for registering / deregistering listeners. It also seems that the "close" event doesn't exist anymore, at least I found no reference to it.
The approach to fixing the issue was to listen for a "removeClass" event. When we get one of those, we check the event phase, it needs to be "close". This seems to be about the point where the old $animate:close event would have been triggered.
Unfortunately, the $animate service does not provide functions for registering one off listeners like element.one, so I've had to manually remove the event listener in the handler.
Finally, when all that was working, I re-introduced the old mechanism for Angular 1.3 support (I assume we'll want to support both).
This fixes #3633
Hopefully that'll sort it!