That\'s the way I use the ng2-bootstrap modal:
import {Component} from \'@angular/core\';
import {NgbModal} from \'@ng-bootstrap/ng-bootstrap\';
@Component({
I would suggest you look at the Child Modal example here ng2-bootstrap documentation for modals. Just add public variables to the parent component and use them in your modal using standard binding techniques.
So in the example add this to the template like so:
{{parentMessage}}
and change the component like this:
export class DemoModalChildComponent {
@ViewChild('childModal') public childModal:ModalDirective;
parentMessage = 'I am a child modal, opened from parent component!'; //Add this
Now you that you are passing in data from the parent component you can pass data to the parent component by following the standard patterns.