How it works...

First, let's take a look at the template home.html:

<ion-content padding>  <ion-item padding>    <ion-label color="primary" stacked>Notification Message</ion-label>    <ion-input placeholder="Enter Notification Text here" [(ngModel)]="message"></ion-input>  </ion-item>  <button full ion-button color="primary" (click)="showNotification('now')">Show Notification</button>  <ion-item padding>    <ion-label>Time in seconds</ion-label>    <ion-datetime displayFormat="ss Second" placeholder="" [(ngModel)]="time"></ion-datetime>  </ion-item>  <button full ion-button color="primary" (click)="showNotification('future')">Schedule a Notification</button> <button full ion-button color="primary" (click)="clearNotifications()">Clear all Notifications</button> ...

Get Ionic Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.