In my Angular 4 app, let\'s assume that I\'m inside a service.
At some point, I want to ask the user for a confirmation, currently I\'m doing it with just a co
I used the solution from @Chandru, however to return a true
or false
, instead of:
openConfirmDialog() {
this.modalRef = this.modalService.show(HomeModalComponent);
this.modalRef.content.onClose.subscribe(result => {
console.log('results', result);
})
}
I simply used:
openConfirmDialog() {
this.modalRef = this.modalService.show(HomeModalComponent);
return this.modalRef.content.onClose;
}