question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Any way to control class="modal-dialog" & class="modal-content" in BsModalService ?

See original GitHub issue

Actually I am searching for way to get control over class="modal-dialog" & class="modal-content" while opening modal by using BsModalService.

My application has different type of modal with different size of height width. In Angular 1.5.x we were sending modal configurable option and add them accordingly in windowTemplateUrl file.Now, I am trying to implement same configurability in ngx-bootstrap-modal.

In Angular 1.5.x we were using ui.bootstrap.modal

I found that BsModalService place dynamic component within modal-content div.

<div class="modal-dialog">
<div class="modal-content">
	<app-modal-content-component></app-modal-content-component>
</div>
</div>

Due to this, there is no way to control over these two parent div.

I supposed to add height,width,header title in dynamic way by passing from hosting controller. I would also like to add modal draggability in class="modal-content"

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
IlyaSurmaycommented, Aug 7, 2017

You can add another css class to modal: this.modalService.show(Component, {class: 'modal-lg'})); and after that you’ll be able to control width, height, position, etc. If you want to fully control modal template, use directive instead of service

10reactions
AbhijitMukecommented, Apr 4, 2018

You can override all modal related classes in your component SCSS file by adding encapsulation: ViewEncapsulation.None to your modal component under @Component decorator.

Use your style with modal class name like - modal-content modal modal-header

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to center an ngx-bootstrap modal - Stack Overflow
You have to pass the modal-dialog-centered bootstrap class for the BsModalService.show() ...
Read more >
Managing Multiple Bootstrap Modals - Arroyo Labs
When ModalOne is to close to make room for ModalTwo, both modals fight to make its respective changes: ModalOne wants to remove the...
Read more >
Modal - Bootstrap
Modal. Use Bootstrap's JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content. How it works....
Read more >
Modal - Angular powered Bootstrap
You can pass an existing component as content of the modal window. ... ngbAutofocus class="btn btn-danger" (click)="modal.close('Ok click')">Ok</button>.
Read more >
Use of Ngx-Bootstrap Modal Popup in Angular 8 - C# Corner
export class ModalPopupComponent implements OnInit {; modalRef: BsModalRef;; constructor(private modalService: BsModalService) { } ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found