ng-sweetalert2-slc

0.1.7 • Public • Published

ng-sweetalert2-slc

Sweetalert2 for angular 2 cli application.

Install

npm i -s ng-sweetalert2-slc

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 'ng-sweetalert2-slc';

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

@NgModule({
  providers: [SweetAlertService]
})

Package Sidebar

Install

npm i ng-sweetalert2-slc

Weekly Downloads

0

Version

0.1.7

License

MIT

Last publish

Collaborators

  • selcukkutuk