npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@binssoft/ngx-dialogs

v1.0.2

Published

All type of dialogs in one package for angular

Downloads

11

Readme

@binssoft/ngx-dialogs

All type of dialogs in one package for angular

Build Status Support Support Support License

Please support this project by simply putting a Github star. Share this library with friends on Twitter and everywhere else you can.

enter image description here

Table of contents:

Getting started

Installation

npm install @binssoft/ngx-dialogs --save

Implementation

import "NgxDialogsModule" in your application module. For example: app.module.ts

import {NgxDialogsModule} from '@binssoft/ngx-dialogs';
@NgModule({
    imports :[
	    NgxDialogsModule
	    ...
    ]
})
export class AppModule { }

add configration in your component. For example : MyOwn.component.ts

import {NgxDialog} from '@binssoft/ngx-dialogs';

export  class  MyOwnComponent  implements  OnInit {
    constructor(
	    private alert :  NgxDialogs
    ) { }
}

Simple Alert Dialog

this.alert.create({
    title: 'Simple Dialog',
    message: 'It is a simple alert dialog',
}, ()=>{ alert('after close') });

Dialog with custom style

this.alert.create({
    title: 'Custom style Dialog',
    message: 'It is a custom style alert dialog',
    customCssClass: 'custom-alert'
}, ()=>{ alert('after close') });

Dialog with custom buttons

this.alert.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');
		    }
	    }
    ]
});

Confirm Dialog

this.alert.create({
    title: 'Confirm Dialog',
    message: 'It is a confirm dialog box',
    confirm: ()=> {
	    alert('you click "yes"');
    },
    cancel: ()=> {
	    alert('you click "cancel"');
    },
});

Dialog with static background

this.alert.create({
    title :'Dialog with static background',
    message : 'It is a dialog with static backgrond. only close by clicking on "x" ',
    strict: true
});

Modal Dialog

export class MyOwnComponent implements OnInit {
    modalDialogConfig: any = {};
    openModalDialog() {
	    this.modalDialogConfig = {};
	    this.modalDialogConfig['title'] = 'Simple Modal';
	    this.modalDialogConfig['type'] = 'M';
	    this.modalDialogConfig['strict'] = true;
    }
}
HTML
<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>

Image Lightbox Dialog

openLightBoxDialog() {
	this.alert.create({
    	"src": 'path/to/big/image/img.jpg'
	});
}
HTML
<img title="Click to open light box" src="path/to/thumb/img-thumb.jpg" (click)="openLightBoxDialog()"/>

Close Dialog dynamiclly

this.alert.remove();

Settings Option

|Name | Description | Default Value | Example | Mandatory| |--|--|--|--|--| | title | to display the heading of the dialog | NULL | 'title':'Sample Heading'|NO | message | to display the message of the dialog | NULL | 'message':'Message of the alert box'|YES | verticalAlign | to set vertical position of dialog | NULL | 'verticalAlign':'top/end'|NO | duration | to set to close dialog autmatically after nth Sec | NULL | 'duration':nth(s)|NO | icon | to display icon within the dialog| NULL | 'icon':success/error/info/warning|NO | src | to add the image path for lightbox dialog | NULL | 'src':'http://test-domain/img.jpg'|YES(if it is a image lightbox dialog) | strict | to make the dialog background static | false | 'strict': true|NO | customCssClass | to add custom css clas with the dialog| NULL | 'customCssClass': 'custom-dialog'|NO | type | to manage the dialog width| 'S' | 'type': 'S/M/L/XL' |NO | confirm | event only for confirm dialog| ()=>{} | confirm:()=>{ alert('click on confirm'); }|YES(if you want confirm message box) | buttons | to manage multiple custom buttons in the dialog | [] | buttons : [ {title : 'Ok',class: 'ok-btn',event : ()=>{alert('you press ok');}},]|NO | buttons.title |to add the text of the button| 'OK' | buttons : [ {title : 'Ok'}]|YES | buttons.class |to add the custom class of the button| 'ok-btn' | buttons : [ {class : 'ok-btn'}]|NO | buttons.event | event of the perticular button | ()=>{} | buttons : [ {event : ()=>{alert('you press ok');}}]|YES

Demo

Click Here for the demo

Creator

Tonmoy Nandy

License

The MIT License (MIT)

Keywords

angular ng dialog modal confirm alert