1.0.6 • Published 3 years ago

@tgawhale/confirm-box v1.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

ConfirmBox

Its displays a beautiful confirm box with minimal code.

It's developed using Angular 10

alt text

How to install

npm install @tgawhale/confirm-box

Steps

  1. Install by running npm install @tgawhale/confirm-box;
  2. Import ConfirmBoxModule in your angular module;
import { ConfirmBoxModule } from 'confirm-box';

@NgModule({
  ....
  imports: [ConfirmBoxModule, ....],
  ....
  ....
})
  1. Declare <confirm-box></confirm-box> at below of your root component.
  2. Create a ConfirmBoxService object in constructor of your component.
  3. Use the following method to show dailog
show(title , description , (val)=>{ //your code after clicked on confirm button }

Example

1. app.module.ts

import { ConfirmBoxModule } from 'confirm-box';

@NgModule({
  ....
  imports: [ConfirmBoxModule, ....],
  ....
  ....
})

2. app.component.html

<button (click)="openConfirmBox()">Open</button>
<confirm-box></confirm-box>

3. app.component.html

import { ConfirmBoxService } from 'confirm-box';

constructor(private cbService: ConfirmBoxService) {}

 openConfirmBox() {
    this.cbService.show('The item will be deleted', 'The current selected item will be deleted. The process is irreversible.', (val) => {
      alert(val);
    });
  }
  
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago