That\'s the way I use the ng2-bootstrap modal:
import {Component} from \'@angular/core\';
import {NgbModal} from \'@ng-bootstrap/ng-bootstrap\';
@Component({
To pass parameters/data to the modal, my guess would be to use the componentInstance
:
open(content) {
const modal: NgbModalRef = this.modalService.open(content, { size: 'lg' });
(model.componentInstance).data = 'hi';
modal.result.then((result) => {
console.log(result);
}, (reason) => {
console.log(reason);
});
}
This assumes that the componentInstance is of type MyComponent
and that it has a public property data