ng-sweetalert2-slc
v0.1.7
Published
Sweetalert2 for angular 2 cli application.
Downloads
3
Readme
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]
})