yalabot / angular-foundation

http://pineconellc.github.io/angular-foundation/
Other
1.05k stars 266 forks source link

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

Open jogjayr opened 8 years ago

jogjayr commented 8 years ago

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:

Actual:

DmytroYeremieiev commented 8 years ago

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