In this article, We learn how to apply and implement SweetAlert2 in Angular. I will show how to do it, and just follow the steps clearly.

For more updates please do Subscribe via Email:

SweetAlert2

Sweet Alert is a method or way to customize alert notification in your application, website, or games. It is more presentable and UI friendly and fit for the new trend design. you can customize the text, color, button, and also the icon.

Installation to angular

To install the SweetAlert2 packages just run this code in your terminal.

npm i sweetalert2

To understand what is npm mean just refer this LINK . And i tag is shorten for install.

Implementation

Import this into your type-script file.

import Swal from 'sweetalert2';

Simple Sweet Alert working and this is appeared in the center of your screen.

Swal.fire(
      'Good job!',
      'You clicked the button!',
      'success'
    )

GitHub Link: https://github.com/JaveTLupango/AngularCRUD/tree/SweetAlertAngular/src/app/sweet-alert

for more guide about customize alert. please refer this link : https://sweetalert2.github.io/

Related Topics

One Reply to “How to implement SweetAlert2 Notification in Angular”

Leave a Reply

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