File

libs/upp-base/src/modules/toasts.ts

Index

Properties
Methods

Constructor

constructor(lang: languageService, toast: ToastController, loadingCtr: LoadingController)

Creates an instance of the toastService.

Parameters :
Name Type Optional Description
lang languageService No
  • The language service for retrieving localized strings.
toast ToastController No
  • The Ionic ToastController for displaying toast notifications.
loadingCtr LoadingController No
  • The Ionic LoadingController for displaying loading indicators.

Methods

HideWait
HideWait()

Dismisses the currently visible loading indicator after a short delay.

Returns : void
Async ShowAlert
ShowAlert(type: toastType, text: string, duration: number)

Displays a toast notification.

Example :
          Accepts `'primary'`, `'success'`, `'warning'`, or `'danger'`.
Parameters :
Name Type Optional Default value Description
type toastType No
  • The type of the toast. It determines the color and style of the toast. Accepts 'primary', 'success', 'warning', or 'danger'.
text string No
  • The message to display in the toast notification.
duration number No 5000
  • (Optional) The duration the toast should be visible (in milliseconds). Defaults to 5000ms.
Returns : any

A Promise that resolves once the toast is presented.

Async ShowWait
ShowWait(message: string | null, timeout: number)

Displays a loading indicator with an optional custom message.

Parameters :
Name Type Optional Default value Description
message string | null No null
  • (Optional) The message to display. If not provided, the service will use the localized message for "@loading_wait".
timeout number No 5000
  • (Optional) Duration for how long the loading indicator should be visible (in milliseconds). Defaults to 5000ms.
Returns : any

A Promise that resolves once the loading indicator is presented.

Properties

Public loadingCtr
Type : LoadingController
- The Ionic `LoadingController` for displaying loading indicators.
Public toast
Type : ToastController
- The Ionic `ToastController` for displaying toast notifications.

results matching ""

    No results matching ""