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.

How to make the Model Large same as bootstrap Model

See original GitHub issue

now the Model has class name as ‘modal-dialog’ , how can i use <div class="modal-dialog modal-lg"> to make the Model large ?

capture

Issue Analytics

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

github_iconTop GitHub Comments

12reactions
Stanley521commented, May 28, 2018

you can put a class name on open using ts this.modalService.open(component, { windowClass: ‘classname’});

use ‘::ng-deep’ for strong code and target the modal-dialog class css ::ng-deep .classname .modal-dialog{ max-width: 90%; width: 90%; }

8reactions
paustintcommented, May 14, 2017

When you are opening the modal in your typescript class, the second parameter is the NgbModalOptions object, which includes the size parameter (lg or sm).

Size is mentioned in the docs, referenced here: https://ng-bootstrap.github.io/#/components/modal

Source code to see how this translates into the rendered template https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/modal/modal.ts https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/modal/modal-window.ts

Example

  openModal(content) {
    this.modalService.open(content, {size: 'lg'}).result
    .then((result) => {

    }, (reason) => {

    });
  }
<ng-template #modalContent let-c="close" let-d="dismiss" id="modal-container">
  <div class="modal-header">
    <button type="button" class="close" aria-label="Close" (click)="d('exit')">
      <span aria-hidden="true">&times;</span>
    </button>
    <h4 class="modal-title">modal title</h4>
  </div>
  <div class="modal-body">
  some stuff in the body
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-danger float-left" (click)="c('close-button')">Cancel</button>
    <button type="button" class="btn btn-success float-right" (click)="someAction(c)">
      Submit
    </button>
  </div>
</ng-template>


<button class="btn btn-success" (click)="openModal(modalContent)"></button>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Trying to make bootstrap modal wider - Stack Overflow
Now, you can make your modal be XXL size simply by adding the .modal-xxl modifier class to your .modal-dialog , and your modal...
Read more >
Modal - Bootstrap
Utilize the Bootstrap grid system within a modal by nesting .container-fluid within the .modal-body . Then, use the normal grid system classes as...
Read more >
Bootstrap Modal Sizing - free examples & tutorial
Responsive popup window sizing with Bootstrap 5. Modal width, modal height, fullscreen modal, large modal with lg & xl modal classes and more....
Read more >
Bootstrap Modal Plugin - W3Schools
Change the size of the modal by adding the .modal-sm class for small modals or .modal-lg class for large modals. Add the size...
Read more >
Bootstrap 3 Tutorial 83 - Modal Sizing - YouTube
Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top...
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