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

fix(modal): dismiss modal on unschedule destruction #4097

Closed
wants to merge 1 commit into from

Conversation

wesleycho
Copy link
Contributor

  • Dismiss modal via modalInstance.dismiss if the $scope undergoes an unscheduled destruction

Plunker in action here

This fixes #3694.

@chrisirhc
Copy link
Contributor

Smart solution. Perhaps this needs tests?

@wesleycho
Copy link
Contributor Author

I'll write up a test tomorrow - should be easy.

@wesleycho
Copy link
Contributor Author

What are your thoughts on what the dismissal should reject the promise with? I just chose an arbitrary string to have something that can be hooked to, but I'm not partial to any particular form of the api there.

@Foxandxss
Copy link
Contributor

Yup, need tests.

- Dismiss modal via `modalInstance.dismiss` if the `$scope` undergoes an unscheduled destruction
@wesleycho
Copy link
Contributor Author

Added test

@Foxandxss
Copy link
Contributor

I don't mind the string chosen. It just need one unique.

@wesleycho wesleycho closed this in 3584061 Aug 4, 2015
@wesleycho wesleycho deleted the fix/modal-scope branch August 4, 2015 18:40
@chrisirhc
Copy link
Contributor

@wesleycho sorry, didn't see your reply until now, $uibUnscheduledDestruction could be clearer?

@wesleycho
Copy link
Contributor Author

Sure, I can change that right now.

wesleycho added a commit that referenced this pull request Aug 5, 2015
- Change to `$uibUnscheduledDestruction` as per comment in #4097
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$modal cant be dismissed if state [ui-router] is changed
3 participants