I am using ngx-bootstrap's modals and I want to change the CSS class modal-dialog with some other properties.
My question is: How do I dynamically change the properties of for example this class in Angular?
I have played around with ElementRef, TemplateRef and Rendere2 but not found any solution.
Thanks for you help in advance.
EDIT 1:
I am opening the modal using BsModalService, so my template looks like this:
<ng-template #defaultModalTemplate>
Content
</ng-template>
I open the dialog like this:
public openModal(): void {
this.modalRef = this.modalService.show(this.templateRef);
if (this.renderer && this.templateRef) { // trying to extract .modal-dialog here
}
}
the variable templateRef is defined like this:
@ViewChild('defaultModalTemplate') public templateRef?: TemplateRef<any>;
ngClassorngStyle?ngClassorngStyle