ng-confirm-box
v0.1.1
Published
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.2.0.
Downloads
356
Readme
NgConfirm
This library was generated with Angular CLI version 14.2.0.
Features
- Easy to install
- Inbuilt Animation
- configuartion is easy
Install
npm i ng-confirm-box
Setup
Add NgConfirmModule to App NgModule
import NgConfirmModule in app.module.ts
import { NgModule } from '@angular/core';
import { HeaderComponent } from './component/header/header.component';
import {NgConfirmModule} from 'ng-confirm-box'; <---- to be added
@NgModule({
declarations: [
HeaderComponent,
],
imports: [
NgConfirmModule <---- to be added
],
})
export class AppModule { }
- use the selector in app.component.html file
Use
import { Component } from '@angular/core';
import { NgConfirmService } from 'ng-confirm-box';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
constructor(
private confirmService: NgConfirmService <---to be injected
) { }
ngOnInit(): void {
}
deleteEmployee(id: number) {
this.confirmService.showConfirm("Are you sure want to Delete?",
() => {
//your logic if Yes clicked
},
() => {
//yor logic if No clicked
})
}
}
Upcoming features
- Dynamic Themes
- Dynamic Animation
License
MIT
GitHub @SashikumarYadav · LinkedIn @SashikumarYadav · Medium @SashikumarYadav