Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Modal: pass the closedDeferred promise to removeAfterAnimate function #5322

Closed
wants to merge 1 commit into from

Conversation

javix
Copy link

@javix javix commented Jan 21, 2016

If I close the modal the closed promise will not be called.

modalInstance.closed.then(function() {
    console.log('closed', arguments);
});

@Foxandxss
Copy link
Contributor

Sure, let me grab my crystal ball and figure out what is the purpose of this PR.

@javix
Copy link
Author

javix commented Jan 21, 2016

Hallo,
I am little bit confused about the failed tests and about the implementation of the function toBeResolvedWith in modal.spec.js.

The promise closedDeferred will be resolved only in the function afterAnimating() in modal.js line 369.
I added console.log("afterAnimating", closedDeferred); in the function afterAnimating() (line 359).
Without my changes, I get follow output with log level DEBUG

LOG: 'afterAnimating', undefined

and the line closedDeferred.resolve(); will not be called.

With my changes, I get

LOG: 'afterAnimating', Deferred{promise: Promise{$$state: Object{status: ...}}, resolve: function (value) { ... }, reject: function (value) { ... }, notify: function (value) { ... }}

@javix javix changed the title pass the closedDeferred promise to removeAfterAnimate function Modal: pass the closedDeferred promise to removeAfterAnimate function Jan 21, 2016
@Foxandxss
Copy link
Contributor

I see, my friend @wesleycho is looking into it.

Thanks.

@wesleycho
Copy link
Contributor

@armagedon looks like somehow the tests were flawed for this - I fixed them in #5326.

@wesleycho wesleycho closed this in d5a48ea Jan 21, 2016
@javix javix deleted the develop branch January 22, 2016 07:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants