Onsen UI ons.notification.alert question

following code

var i=0;
i++;
ons.notification.alert({message: i});
i++;
ons.notification.alert({message: i});
i++;
ons.notification.alert({message: i});

      

Notification result:

3
  2
 1

Can someone explain the Onsen Alert mechanism?

Thank.

+3


source to share


1 answer


They are all displayed at the same time, but the latter is displayed on top of the others.

If you want to display them sequentially, you need to use the parameter callback

.



ons.notification.alert({
  message: 'First message',
  callback: function() {
    ons.notification.alert({
      message: 'Second message'
    });
  }
});

      

http://codepen.io/argelius/pen/qdoZXX

+3


source







All Articles