Can't create alert on modal dismiss


From a regular page, I am opening a modal. Once returned from it, the modal.onDismiss is called.

In onDismiss, I call a http and subscribe to it. Once the data returned, I want to call an alert. Something like

modal.onDismiss(modalData) {
  data => {
     let alert = Alert.create({title: 'Alert', buttons: [Ok]});
}, ....);

The alert is shown, but I get a black screen behind and the error

EXCEPTION: TypeError: Cannot read property ‘nativeElement’ of undefined

Any clue?

1 Like