Angular Dialog directives with Bootstrap 3
Solution 1
As the other answers have stated, this is due to breaking changes in Bootstrap 3. Until the Angular UI team have fixed these issues (currently under development, see the bootstrap3_bis branch) there is a css workaround just for dialog boxes detailed in this blog post:
.modal { display: block; }
Working plunkr is available here:
http://plnkr.co/edit/nZT58YNKT84UlSwTvfpc?p=preview
Solution 2
There's a pull request pending that contains fixes for most of the issues with Bootstrap 3.0 and the AngularUi directives, including the issues with the dialogs (which were certainly the most frustrating ones for me!):
https://github.com/angular-ui/bootstrap/pull/742
(See Bootstrap 3 compatible with current AngularJS bootstrap directives?)
Related videos on Youtube
KEB
Updated on June 04, 2022Comments
-
KEB almost 2 years
We're trying to migrate from Bootstrap 2.3.2 to Bootstrap 3 (RC1) and are having problems with the AngularJS Dialog directive. On clicking the relevant button no dialogue popup appears (the page appears black. Clicking anywhere returns to the original non-black view).
We're essentially using exactly the same code as in the above link.
There is a known issue discussed here. In that discussion Luther suggests:
"to have modal worked, add hide class to set display:none to modal and reset the modal's display to block"
That unfortunately doesn't seem to make any difference. What alternatives could we use to get the dialogs appearing in Bootstrap 3 RC1?
I've tried using the Modal directive instead. It has a similar problem where the page fades (rather than goes completely black) and the popup also doesn't appear.
-
JoshGough over 10 yearsThanks, I added .modal { display: block; height: 0; overflow: visible; } And that is helping get around at least one problem :)
-
Alan Klement over 10 yearsThanks. The linked plunkr example doesn't work for version 0.6 (it does work for version 0.5). I get an 'Unknown provider: $dialogProvider <- $dialog' error. Any idea on how to fix this?
-
Mutahhir over 10 years@AlanKlement $dialog is no more, using Modal now, use it by including 'ui.bootstrap.modal' and use the $modal service. The angular bootstrap project page is updated with how to use it. There are API changes too, so don't just find/replace :)
-
Alan Klement over 10 years@ Mutahhir thanks. Do you have a link? I'm looking now, but just want to make sure I'm looking at the right thing.
-
Alan Klement over 10 years@Mutahhir Actually, I can't find anything your talking about. All I can find are discussions about how $modal is being rewritten. Perhaps it's in some branch somewhere.... I can't figure it out.
-
Mutahhir over 10 years@AlanKlement It's right there on the main page now: angular-ui.github.io/bootstrap/#/modal
-
CalM over 10 yearsThere is a separate branch with updated templates ... github.com/angular-ui/bootstrap/tree/bootstrap3_bis2