Reputation: 402
I created a css modification to change the modal width to 50% against 100% of the view. But the class modal-content is duplicated against modificated.
CSS
.modal-content{
width: 50%;
}
HTML
<ng-template #content>
<div class="modal-content">
<div class="modal-header">
<i class="fa fa-heart"></i> A
</div>
<div class="modal-footer">
<i class="fa fa-heart"></i> B
</div>
</div>
</ng-template>
Upvotes: 1
Views: 2280
Reputation: 1605
I also faced the same issue in my development and i found the solution with help of windowClass
in ng-bootstrap
const modalRef = this.modalService.open(UserPasswordComponent, {
windowClass: 'custom-modal-width' // add a custom class here where you open the modal
});
In your style.css
control the width
.custom-modal-width .modal-content {
width: 50%;
}
make sure to remove your model-content
class in your template
Upvotes: 1