I am new to angular material. i am trying to implement alert to display messages using angular material which is similar in bootstrap alert ie.
<div class="alert alert-success" role="alert">
<strong>Well done!</strong> You successfully read this important alert message.
</div>
<div class="alert alert-info" role="alert">
<strong>Heads up!</strong> This alert needs your attention, but it's not super important.
</div>
<div class="alert alert-warning" role="alert">
<strong>Warning!</strong> Better check yourself, you're not looking too good.
</div>
<div class="alert alert-danger" role="alert">
<strong>Oh snap!</strong> Change a few things up and try submitting again.
</div>
Can anyone help me what is the best way to implement in angular material?
Many Thanks
Angular materials Doesnot Have built-in Alert Component but you can implement one very easy and customize it ,This implementation includes one component and one service which template and css file complete these composition .
Alert Component
Alert Template
Alert Style
Alert Service
Typical usages
Usage Example Which Displays Alert on Login Failure
You can take advantage of *ngIf if want to display more then just simple string like below:
note that I am using some bootstrap classes for styling.