I have an Angular 6 app that I am trying to implement a modal window that slides in from the right side of the screen, like shown here: https://codepen.io/anon/pen/OayRVy
But, no matter what I try, I cannot override the positioning of the modal window. The only thing I have been able to change is things like the background color of the header/body.
My modal HTML:
<ng-template #content let-modal="close">
<div class="modal-header">
<h4 class="modal-title" id="modal-basic-title">Table of Contents</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" (click)="dismissModal(modal)"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<p>
....
</p>
</div>
</ng-template>
Component code:
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
constructor(private modalService: NgbModal) {}
public open(content) {
this.modalService.open(content, {ariaLabelledBy: 'modal-basic-title', size: 'lg'}).result.then((result) => {
...
}, (reason) => {
...
});
}
If I inspect the HTML and in Chrome DevTools add a float: right
property to the .modal-dialog
container, it will do what I want. But, adding a
.modal-dialog {
float: right;
}
to my .scss file for the component has no effect.
Can anyone show me how to override the default bootstrap styling so I can force it to appear on the right side of the screen and take up 100% of the height?