I want to pass a modal event from the child component to the modal's parent component, but i got an error " modalRf.componentInstance.confirmationEvent is not a function"
child Component: ModalTestComponent.ts
@Input() idModal: string;
@Input() titre: string;
@Input() message: string;
@Output() confirmationEvent = new EventEmitter<any>();
constructor(public activeModal: NgbActiveModal) {
}
public confirmer() {
this.confirmationEvent.emit();
}
Parent Component
openActiviteModal() {
const modalRf = this.modalService.open(ModalTestComponent, 'TestModalId');
modalRf.componentInstance.titre = 'HELLO WORLD';
modalRf.componentInstance.message = 'THANKS';
modalRf.componentInstance.confirmationEvent().subscribe(
res => {
if (res && res !== '' && res !== undefined) {
this.afterConfirmChangementActivite();
}
}
);
}