Notifying users with Messages and Growl

The Message component is used to display messages in an inline format to notify the users. These Messages are notified as the result of a specific action. Each Message in PrimeNG API is defined using the Message interface, which defines severity, summary, and detail properties.

A basic example of Messages to notify the user would be as follows:

<p-messages ([value])="messages" name="basic"></p-messages>

In the preceding example, Messages are displayed using the value property, which defines an array of the Message interfaces. The component will be rendered as shown in the following screenshot:

The severity of Messages are represented with the class property. The possible values of Messages severity would be as follows:

Severity Class name
success .ui-button-success
info .ui-button-info
warn .ui-button-warn
error .ui-button-error

 

The Messages are closable by default with the help of the cross icon located at the top-right corner. This behavior can be altered through the closable property, that is, [closable]="false" disables the closable nature of Messages.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.196.244