UNPKG

angular-sweetalert-2

Version:

A really simple Sweet Alert 2 wrapper to Angular 1.x

37 lines (32 loc) 827 B
# Angular Sweet Alert 2 Sweet Alert it's enough simple (maybe not?), so, here we have a simple port to Angular 1.x. # How to use? * Download & Install [Sweet Alert 2](https://limonte.github.io/sweetalert2/) ```bash npm install sweetalert2 ``` * Download & Install angular-sweetalert-2 ```bash npm install angular-sweetalert-2 ``` * Include socialbase.sweetAlert module ```javascript angular.module('yourmodule', ['socialbase.sweetAlert']); ``` * Inject SweetAlert factory ```javascript Foo.$inject = ['SweetAlert'] ``` * Read [Sweet Alert 2 API](https://limonte.github.io/sweetalert2/) * Use and abuse ```javascript Foo.$inject = ['SweetAlert'] function Foo(SweetAlert) { SweetAlert.swal({ type: 'success', text: 'Hello world' }).then(function (response) { console.log('World says hello too!'); } } ```