That\'s the way I use the ng2-bootstrap modal:
import {Component} from \'@angular/core\';
import {NgbModal} from \'@ng-bootstrap/ng-bootstrap\';
@Component({
Anyone still stumbling onto this might find this handy, all you need to do is declare a field inside your ModalComponent like this:
modalHeader: string;
advertiser: Advertiser;
You can set these fields by doing the following when you are opening a modal.
advertiserModalShow() {
const activeModal = this.modalService.open(AdvertiserModal, { size: 'lg' });
activeModal.componentInstance.modalHeader = 'Advertiser';
activeModal.componentInstance.advertiser = this.selectedAdvertiser;
}
In your template you can access them like this:
value={{advertiser.code}}
Hope this helps.