Prime Ng Toast & Messages

Today I want to show you how to use prime ng toast and message component. This will be a good primeNg toast example. First, we have to install primeng with npm to our angular project. We can do it by running these commands in our node terminal.  I am using VS Code for developing UI projects. So its easy to do it with VSCode.

And we must add MessageService and ToastModule to app.module.ts file.

After installing packages, we must include them in our component.ts file and use it in the functions to show messages.

And we need to call toast component in html file to show messages to user.

Dont forget to add these css codes to angular.json file.

You can have a look at my other post about Top 10 Developer Tools

If you have question do not forget to write from the chat button next to it or from the comment

You may also like...

2 Responses

  1. Brajesh Kokkonda says:

    Thank you so much for providing a great example. You have saved my time. I should propose your website better than the PrimeNG official documentation 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *