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

ngv-dialog

v3.4.4

Published

An open source library for angular , generated in angular 14

Downloads

6

Readme

NgvDialog

An open source library for angular , generated in angular 14

Why Ngv Dialog ?

  • it's open source.
  • you can open dialog by routes and service that we provided before ...
  • you can set attributes like space and clickable back-drop etc .
  • you don't need to add any component tag in your code .
  • you will use just a service to work with package and nothing else .

How to use ?

  • npm install ngv-dialog - to install package in your project.
  • In your AppModule import the NgvDialogModule
  • then in your component use NgvDialog to work with that
import { NgvDialogModule } from 'ngv-dialog';
imports: [
    ...
      NgvDialogModule,
    ...
]
import { NgvDialog } from 'ngv-dialog';
@Component({
  selector: 'app-component',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
  ngvDialog = inject(NgvDialog);
  openDialog(): void {
    this.ngvDialog.open(MyExampleComponent)
  }
}
  • you can set some configuration like the below code :
  • backDropClose - a boolean value , to be able to close dialog by click to backdrop.
  • space - a number value , the space around dialog sheet and content.
  • backDropStyle - a string value , could be none for default value , blur and gray.
this.ngvDialog.open(MyExampleComponent, {
  backDropClose: true,
  space: 16,
  backDropStyle: 'blur',
})
  • you can close dialog by use close('your message') that could be any type and send a message to close subscriber.
this.ngvDialog.open(MyExampleComponent).afterClose().then(closeMessage => {
  // there will got 'my close message could be any type'
})

// and in the MyExampleComponent you can close it
 closeAction(): void {
  this.ngvDialog.close('my close message could be any type')
}
  • as you can see at below code, use can use set a data to use it when dialog opened.
this.ngvDialog.open(MyExampleComponent, {
  data: {
    userData: {
      gitHub: 'https://github.com/wahidwex'
    }
  }
})
import { NgvDialog } from 'ngv-dialog';
@Component({
  selector: 'app-component',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class MyExampleComponent implements OnInit {
  ngvDialog = inject(NgvDialog);
  ngOnInit(): void {
    const data = this.ngvDialog.getData();
    ...
  }
}

How to open dialog by routes?

  • when you want to import the module , which will open your dialog as you want , like below
import { NgvDialogModule } from 'ngv-dialog';
imports: [
    ...
      NgvDialogModule.setRoutes({
      options : {
        backDropClose: true,
        space: 16,
        backDropStyle: 'blur',
      },
      list: [
        {
          fragment: 'article',
          component: ArticleComponent
        },
        {
          fragment: 'example',
          component: MyExampleComponent
        },
      ],
    }),
    ...
]
  • so when you want to open MyExampleComponent you just need to add example fragment ...