I would like to use Ng Bootstrap Modal with a child component as the modal body. I'm not sure how I would achieve this...
export class ParentComponent {
@ViewChild("modal") private engineModal: TemplateRef<any>;
dialog: NgbModalRef | null;
constructor(private modalService: NgbModal) {}
openModal(): void {
this.dialog = this.modalService.open(this.engineModal);
}
cancelModal (): void {
if ( this.dialog ) {
this.dialog.dismiss();
this.dialog = null;
}
}
}
and, I know this is wrong, but ultimately I'd like to do something like this,
<ng-template #modal>
<app-child-component></app-child-component>
</ng-template>
Child component has a lot of Input and Output variables, so what whould be the best approach here?