ng-confirm-box
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i ng-confirm-box

Weekly Downloads

72

Version

0.1.1

License

none

Unpacked Size

38.4 kB

Total Files

14

Last publish

Collaborators

  • yshashi30