Skip to content

Class: ToastNotificationInitializer

Boris Jenicek edited this page Dec 20, 2021 · 4 revisions

Class: ToastNotificationInitializer

This is the class that needs to be instantiated to set up and ignite a ToastNotification, its purpose is to show short notification to end-user, or even interact with user. It can be evoked from any angular typescript file.

Below is the example with (some optional) user configuration, it will override default configuration from app.module.

Example:

// Create the initializer.
const newToastNotification = new ToastNotificationInitializer();

// Set desired Title.
newToastNotification.setTitle('Warning!');

// Set desired Message.
newToastNotification.setMessage('Form is not valid!');

// Set desired configuration.
newToastNotification.setConfig({
     layoutType: DialogLayoutDisplay.WARNING
  });

// Open a ToastNotification.
newConfirmBox.openConfirmBox$().subscribe(resp => {
  console.log('confirmBox response: ', resp);
 });

Constructors

constructor

+ new ToastNotificationInitializer(): ToastNotificationInitializer

Returns: ToastNotificationInitializer

Methods

openToastNotification$

openToastNotification$(): Observable<IToastNotificationPublicResponse>

Returns: Observable<IToastNotificationPublicResponse>


setButtonLabels

setButtonLabels(_Confirm: string, _Decline?: string): void

Parameters:

Name Type
_Confirm string
_Decline? string

Returns: void


setButtons

setButtons(_Buttons: IButton[]): void

Parameters:

Name Type
_Buttons IButton[]

Returns: void


setConfig

setConfig(_ToastNotificationConfig: IToastCoreConfig): void

Parameters:

Name Type
_ToastNotificationConfig IToastCoreConfig

Returns: void


setDispatch

setDispatch(_Title: string, _Message?: string): void

Parameters:

Name Type Default value
_Title string -
_Message string null

Returns: void


setMessage

setMessage(_Message: string): void

Parameters:

Name Type
_Message string

Returns: void


setTitle

setTitle(_Title: string): void

Parameters:

Name Type
_Title string

Returns: void

Clone this wiki locally