Skip to content

Toast Object

Ivan Mattie edited this page Jan 21, 2017 · 2 revisions

The Toast object represents an instance of a Toast, which you can get by calling ToastController.openToast().

Methods

open(): null

Opens the Toast, causing it to appear for the user. Also starts a timer for it to disappear and destroy itself.

Note: The ToastController automatically opens all Toasts it creates, so you will only need this method if you are manually instantiating Toasts.

Example:

var myToast = ToastController.openToast({name: "example", text: "Example"});

myToast.open();

close(): null

Closes the Toast, causing it to disappear off the page. Note that once the animation is complete, it will attempt to destroy the DOM elements generated and itself, so this is a single use operation.

Example:

var myToast = ToastController.openToast({name: "example", text: "Example"});

myToast.close();
Clone this wiki locally