0

I am using angular2-modal for the modal alert. I just want to get the confirm event from the modal. How can I get that?

Tahvo.R
  • 51
  • 4
  • 1
    There are plenty of ways to do it. Did you try to search it? Would be also great if you provide more context about your problem – yurzui Feb 24 '17 at 16:04
  • I am using shlomiassaf/angular2-modal. Here is the link You can check this plnkr. In the plukr, you can see custom-modal-sample.ts file. Please look at this function, onKeyUp(value). In this function, if the user enter 5, then the modal will be closed. I want to get the event in the app.component.ts. Is it helpful to clear? – Tahvo.R Feb 24 '17 at 17:34
  • https://plnkr.co/edit/U038cM?p=preview – yurzui Feb 24 '17 at 17:47
  • That is very helpful. Can you add the close button to the custom-modal-sample.ts and get the event by clicking the button in the app.component.ts? – Tahvo.R Feb 24 '17 at 18:30
  • @yurzui, I just want to know which button is clicked in the app.component,ts. Is there any way for this? – Tahvo.R Feb 24 '17 at 19:02

1 Answers1

0

I can implemented this based on @yurzui's answers. When we close the modal, we use this function,

this.dialog.close();

If we use the function with the parameter, then we can get the result which button is clicked.

Tahvo.R
  • 51
  • 4