
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
ngx-dialogs
Advanced tools
All type of dialogs in one package for angular
Please support this project by simply putting a Github star. Share this library with friends on Twitter and everywhere else you can.
Getting started
npm install ngx-dialogs --save
import "NgxDialogsModule" in your application module. For example: app.module.ts
import {NgxDialogsModule} from 'ngx-dialogs';
@NgModule({
imports :[
NgxDialogsModule
...
]
})
export class AppModule { }
add configration in your component. For example : MyOwn.component.ts
import {Ngxalert} from 'ngx-dialogs';
export class MyOwnComponent implements OnInit {
simpleAlert: any = new Ngxalert;
openSimpleAlert() {
this.simpleAlert.create({
title: 'Simple Dialog',
message: 'It is a simple alert dialog',
});
}
}
<a href="javascript:void(0)" (click)="openSimpleAlert()">Click Here</a>
export class MyOwnComponent implements OnInit {
alertWithustomCssClass: any = new Ngxalert;
openAlertWithCustomCssClass() {
this.alertWithustomCssClass.create({
title: 'Custom style Dialog',
message: 'It is a custom style alert dialog',
customCssClass: 'custom-alert'
});
}
}
<a href="javascript:void(0)" (click)="openAlertWithCustomCssClass()">Click HERE </a>
export class MyOwnComponent implements OnInit {
alertWithBtnObj: any = new Ngxalert;
openAlertWithButton() {
this.alertWithBtnObj.create({
title: 'Dialog with Buttons',
message: 'It is a alert box with buttons',
buttons : [
{
title : 'Ok',
class: 'ok-btn',
event : ()=>{
alert('you press ok');
}
},
{
title : 'Yes',
class: 'yes-btn',
event : ()=>{
alert('you press yes');
}
},
{
title : 'No',
class: 'no-btn',
event : ()=>{
alert('you press No');
}
}
]
});
}
}
<a href="javascript:void(0)" (click)="openAlertWithButton()">Click HERE </a>
export class MyOwnComponent implements OnInit {
confirmAlert: any = new Ngxalert;
openConfirmDialog() {
this.confirmAlert.create({
title: 'Confirm Dialog',
message: 'It is a confirm dialog box',
confirm: ()=> {
alert('you click "yes"');
},
});
}
}
<a href="javascript:void(0)" (click)="openConfirmDialog()">Click HERE </a>
export class MyOwnComponent implements OnInit {
strictBackgroundDialog: any = new Ngxalert;
openstrictBackgroundDialog() {
this.strictBackgroundDialog.create({
title :'Dialog with static background',
message : 'It is a dialog with static backgrond. only close by clicking on "x" ',
strict: true,
type:'M'
});
}
}
<a href="javascript:void(0)" (click)="openstrictBackgroundDialog()">Click HERE </a>
export class MyOwnComponent implements OnInit {
modalDialogConfig: any = {};
openModalDialog() {
this.modalDialogConfig = {};
this.modalDialogConfig['title'] = 'Simple Modal';
this.modalDialogConfig['type'] = 'M';
this.modalDialogConfig['strict'] = true;
}
}
<a href="javascript:void(0)" (click)="openModalDialog()">Click HERE </a>
<ngx-dialogs [config]="modalDialogConfig">
<p>It is a modal dialog</p>
<button (click)="openAlertWithButton()">Open Simple Alert</button>
</ngx-dialogs>
export class MyOwnComponent implements OnInit {
lightBoxDialogConfig: any = new Ngxalert;
openLightBoxDialog() {
this.lightBoxDialogConfig.create({
"src": 'path/to/big/image/img.jpg'
});
}
}
<img title="Click to open light box" src="path/to/thumb/img-thumb.jpg" (click)="openLightBoxDialog()"/>
Name | Description | Default Value | Example |
---|---|---|---|
title | to display the heading of the dialog | NULL | 'title':'Sample Heading' |
message | to display the message of the dialog | NULL | 'message':'Message of the alert box' |
src | to add the image path for lightbox dialog | NULL | 'src':'http://test-domain/img.jpg' |
strict | to make the dialog background static | false | 'strict': true |
customCssClass | to add custom css clas with the dialog | NULL | 'customCssClass': 'custom-dialog' |
type | to manage the dialog width | 'S' | 'type': 'S/M/L/XL' (any one at e time) |
confirm | event only for confirm dialog | ()=>{} | confirm:()=>{ alert('click on confirm'); } |
buttons | to manage multiple custom buttons in the dialog | [] | buttons : [ {title : 'Ok',class: 'ok-btn',event : ()=>{alert('you press ok');}},] |
buttons.title | to add the text of the button | 'OK' | buttons : [ {title : 'Ok'}] |
buttons.class | to add the custom class of the button | 'ok-btn' | buttons : [ {class : 'ok-btn'}] |
buttons.event | event of the perticular button | ()=>{} | buttons : [ {event : ()=>{alert('you press ok');}}] |
Click Here for the demo
FAQs
Unknown package
The npm package ngx-dialogs receives a total of 12 weekly downloads. As such, ngx-dialogs popularity was classified as not popular.
We found that ngx-dialogs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.