Попробуйте этот обходной путь, вам нужно добавить Renderer2 в ваш компонент.
modalRef: BsModalRef;
config = {
animated: true,
class: 'forgot-modal'
};
openModal(template: TemplateRef<any>) {
const onShown: Subscription = this.modalService.onShow.subscribe(() => {
setTimeout(() => {
renderer.addClass(document.body, 'modal-open')
}, 100);
onShown.unsubscribe();
const onHidden: Subscription = this.modalService.onHidden.subscribe(() => {
renderer.removeClass(document.body, 'modal-open');
onHidden.unsubscribe();
});
});
this.modalRef = this.modalService.show(template, this.config);
}
closeModal() {
this.modalRef.hide();
this.modalRef = null;
}