Ngx-bootstrap: Create Modal with Component - passing object as well as settings

Created on 8 May 2018  路  1Comment  路  Source: valor-software/ngx-bootstrap

It appears I cannot pass both an object to the modal as well as settings as the same time ?

const initialState = {
foo: bar
};
this.modalRef = this.modalService.show(PMyModalComponent, { initialState });

I also need to pass the 'class' settings as I need to control the size of the modal outside of the 'small large' examples

Most helpful comment

I resolved this issue, some clarity in the docs would help - sharing for others:

const initialState = { pla: pla }; this.modalRef = this.modalService.show(MyModalComponent, { class: 'gray modal-lg myCustomClass', initialState });

thanks

>All comments

I resolved this issue, some clarity in the docs would help - sharing for others:

const initialState = { pla: pla }; this.modalRef = this.modalService.show(MyModalComponent, { class: 'gray modal-lg myCustomClass', initialState });

thanks

Was this page helpful?
0 / 5 - 0 ratings