I have been encountering issues while trying to use angular 8 and ngx-bootstrap to open modals and pass data from parent to modal. It is not working as expected. Can anyone provide guidance on what steps I should take to resolve this issue? Here is the link to my stackblitz demo and code
HTML
<button type="button" class="btn btn-primary" (click)="openModal(template)">Open modal</button>
<ng-template #template>
<div class="modal-header">
<h4 class="modal-title pull-left">Modal</h4>
<button type="button" class="close pull-right" aria-label="Close" (click)="modalRef.hide()">
<span aria-hidden="true"&rt;×</span>
</button>
</div>
<div class="modal-body">
Just a modal with a {{initialState.data1}}
</div>
</ng-template>
Component
openModal(template: TemplateRef<any>) {
const initialState = {
data1 : 'foo'
}
this.modalRef = this.modalService.show(template, {initialState});
}