I have a modal using the modal service:
import { ModalDialogService } from "nativescript-angular/directives/dialogs";
private modal: ModalDialogService,
I can call a modal, for example
this.modal.showModal(MyModalComponent, options).then(res => {
// console.log(res);
});
Now I want to close the modal, but not from within the modal itself. This already works in iOS:
const page = topmost().currentPage;
if (page && page.modal) {
page.modal.closeModal();
} else {
console.log("error closing modal!!!!");
}
But running this with Android, it will always goes to the error console.log, resulting the modal not being closed. The user can still close it (the modal has a close button), but I also want to programaticly close the modal.