I know there are lots of questions regarding modal not showing and I have it working in places already, but this one is different!
I have a Wordpress
project where I am showing an Angular
app in the admin. The app has Bootstrap 4
used. So I did not want to effect the Wordpress
admin with the Bootstrap 4
css when the Angular
app loads.
To make it work, I used a method where the app is wrapped by a div
with a class="bootstrap"
and I used less
to convert the bootstrap css such that it all is surrounded by the .bootstrap
class. Therefore a class .text-danger
is written like .bootstrap .text-danger
and it works perfect! My admin is not effected by the bootstrap css and yet the angular app inside the admin is isolated.
Now the problem is when I try to add ngb-modal
to the game! It apparently adds the modal and its backdrop elements right before the body tag which is outside the bootstrap wrapper div and therefore the isolated css does not apply on these elements.
Is there a way that when I call the modal like below, it is added with a wrapping div element like this <div class="bootstrap">...ngb-modal code here...</div>
?
const modalRef = this.modalService.open(MyModalComponent);
I hope I explained the issue well!