2.2.0 • Published 1 year ago

@ildug/ngx-confirm v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ngx-confirm

Publish Node.js Package

A mat-dialog to get cofirmations. Use it with a button.

Demo

Installation

npm i @ildug/ngx-confirm

Usage

import the diretive into your component:

...
import { NgxConfirmDirective } from '@ildug/ngx-confirm';
...

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    standalone:true,
    imports:[ ...,  NgxConfirmDirective]
})
export class AppComponent {

    ....

    doSomething() {
        ....
    }

}

Add the directive into a button. Bind the confrim event to the method to trigger.

<button ngxConfirm (confirm)="doSomething()">delete</button>

/* or pass a custom message*/
<button ngxConfirm="my message: Are your sure?" (confirm)="doSomething()">delete</button>

Style

Be sure to,import Angular Material Theme, in order to get a nice behaviour.

@import "@angular/material/prebuilt-themes/azure-blue.css";

To style buttons , you have to define some class:

// with aphrodite-sass
.btn{...}
.btn-main{...}

// or alternatively
.ngx-confirm-btn{...}
.ngx-confirm-btn-main{...}
.ngx-confirm-btn-cancel{...}
2.2.0

1 year ago

1.0.0

2 years ago

2.1.0

2 years ago

0.2.0

3 years ago

0.1.1

4 years ago

0.1.0

4 years ago