Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal opened promise resolves before modal is added to DOM #294

Open
jogjayr opened this issue Feb 8, 2016 · 1 comment
Open

Modal opened promise resolves before modal is added to DOM #294

jogjayr opened this issue Feb 8, 2016 · 1 comment

Comments

@jogjayr
Copy link

jogjayr commented Feb 8, 2016

Steps to repro:

Open a modal using the code below -

$modal.open({
  templateUrl: '<some_url>',
  backdrop: 'static',
  windowClass: 'myCustomModalContainerClass'
}).opened.then(function() {
  angular.element('.reveal-modal-bg').addClass('myCustomModalBg');
});

Expected:

  • angular.element('.reveal-modal-bg') should refer to the modal bg
  • Modal should appear before the opened promise resolves
  • 'myCustomModalBg' should be added as a class to it

Actual:

  • angular.element('.reveal-modal-bg') === []
  • Modal hasn't appeared when the opened promise resolves
  • Custom class isn't added
@DmytroYeremieiev
Copy link

I expected the same issue, circumvent it by wrapping angular.element('.reveal-modal-bg').addClass('myCustomModalBg'); into setTimeout( ... , 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants