Nicole Kemp
Nicole Kemp

Reputation: 33

How do I add multiple options when opening new modal windows with NgbModal.open() method?

I have created a ngbModal using ng-bootstrap. I would like to add multiple NgbModalOptions. ie: { size: 'lg' } and { scrollable: true }.

I have tried writing it in one line separated by commas, it did not work.

open() {
    return this.modalService.open(content, { size: 'lg', scrollable: true });
  }

Argument of type '{size: "lg"; scrollable: boolean; }' is not assignable to parameter of type 'NgbModalOptions'. Object literal may only specify known properties, and 'scrollable' does not exist in type 'NgbModalOptions'.

Upvotes: 1

Views: 1591

Answers (1)

Nicole Kemp
Nicole Kemp

Reputation: 33

The reason the scrollable options does not work is due to the fact that I am using Angular 7 and scrollable option needs a minimum version requirement of Angular 8 and ng-bootstrap version 5.

Read this for more info: https://github.com/ng-bootstrap/ng-bootstrap/issues/3281

Upvotes: 1

Related Questions