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 confirm(...)
request:
const result = confirm('Are you sure?');
What if instead I would like to show an ngx-bootstrap
modal with, let's say, two buttons "Yes" or "No" and obtain a similar result?
EDIT: in my case, I solved my issue by playing with Subjects. Here you can find my solution, in case it can be useful for someone else. However that solution does not solve this question which is about returning a value from a modal, so I leave it open.
Try like this :
myexample it's working correctly. hope this will help you
home.module.ts
home.component.html
home.component.ts
home-modal.component.html
home-modal.component.ts