ngx-sweetalert2

0.2.7 • Public • Published

ngx-sweetalert2

Sweetalert2 for angular x cli application.

Install

npm i -s ngx-sweetalert2

Usage

Add the following sections to the .angular.cli.json file.

"styles"[
"../node_modules/sweetalert2/dist/sweetalert2.css"
],
"scripts"[
"../node_modules/sweetalert2/dist/sweetalert2.js"
],

Next, inject SweetAlertService into a component or module:

import { SweetAlertService } from 'ngx-sweetalert2';
 
@Component({
  providers: [SweetAlertService]
})
export class MyComponent {
  constructor(private _swal2: SweetAlertService) {
    this._swal2.success({ title: 'This is a alert' });
  }
}
import { SweetAlertService } from 'ngx-sweetalert2';
 
@NgModule({
  providers: [SweetAlertService]
})

Readme

Keywords

Package Sidebar

Install

npm i ngx-sweetalert2

Weekly Downloads

136

Version

0.2.7

License

MIT

Unpacked Size

25.8 kB

Total Files

33

Last publish

Collaborators

  • selcukkutuk