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...