How do you do an Alert in Ionic?

Alert is a Javascript library for building native iOS and Android modules. It's used for several Ionic libraries, like the Alert component and the Notification ListView component. There are several ways to make an alert in ionic. The third option is creating a custom message bar that you can add to your page.

ionic 3 alert

on Jan 01, 1970
import { AlertController } from 'ionic-angular';
...
constructor(private alertCtrl: AlertController) {}
...
presentAlert() {
  let alert = this.alertCtrl.create({
    title: 'Low battery',
    subTitle: '10% of battery remaining',
    buttons: ['Dismiss']
  });
  alert.present();
}

Add Comment

0

The most direct way is to use directly the window.alert() method. Another way is using the $ionicUi:ngWarning event.

Javascript answers related to "Ionic alert"

View All Javascript queries

Javascript queries related to "Ionic alert"

Browse Other Code Languages

CodeProZone