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

@agilie/ng2-dialog-window

v0.1.12

Published

Modal dialogs and popups module for Angular applications

Downloads

43

Readme

License

ng2-dialog-window

Dialog window module for Angular (Angular 2) applications which allows to open dialog window using custom components. Any data could be easily send to component.

Installation

To install this module, run:

$ npm install @agilie/ng2-dialog-window --save

Usage

import { NgModule } from '@angular/core';
import { YourDialogWindowComponent } from './component/path'
import { AppComponent } from './app.component'
import { Ng2DialogWindowModule, Ng2DialogWindowService } from '@agilie/ng2-dialog-window';

 
@NgModule({
    imports: [
        // ... 
        Ng2DialogWindowModule
    ],
    declarations: [
        AppComponent,
        // ....
        YourDialogWindowComponent
    ],
    providers: [
        //...
        Ng2DialogWindowService
    ],
    //...
    entryComponents: [
        YourDialogWindowComponent
    ],
})
export class AppModule {
 
}
import { Component, ViewContainerRef } from '@angular/core';
import { Ng2DialogWindowService } from '@agilie/ng2-dialog-window';
import { YourDialogWindowComponent } from './component/path'

 
@Component({
  selector: 'app-component',
  template: '<button (click)="openModal()">Open modal</button>'
})
export class AppComponent {

    constructor( private dialog: Ng2DialogWindowService, private viewContainer: ViewContainerRef) {
        
    }
    
    openModal() {
        this.dialog.openModal(this.viewContainer, {component: YourDialogWindowComponent})
    }

}

You need to extend your dialog component from Ng2DialogWindowComponent to inherit base methods of dialog window and wrap your template in ng2-dialog-window-component tag to extend dialog window base styles.

It seems like Angular doesn't provide any simple way to inherit styles from another component. Feel free to create an issue ticket if you think I am wrong.

import { Component } from '@angular/core';
import { Ng2DialogWindowComponent } from '@agilie/ng2-dialog-window'

@Component({
  selector: 'my-dialog-window',
  template: '<ng2-dialog-window-component><!-- Body of dialog window --></ng2-dialog-window-component>'
})
export class YourDialogWindowComponent extends Ng2DialogWindowComponent {

}

API

Here is the list of accessible methods that you can use:

Ng2DialogWindowService

.openModal(viewContainerRef, options)

Method allows to open dialog window. It creates new dialog instance on each call. It accepts viewContainerRef of component and options object as arguments.

viewContainerRef {viewContainerRef} - viewContainerRef of component from which you call openModal method

options

component {Component} - dialog window component

data {String} | {Object} | {Array} - any serializable data that you want to be stored in dialog component and be available from dialogData.

Dialog component

close() - extended method from base dialog component. Closes dialog window.

TODOs

  1. Add more options (closeByClick, showCloseButton etc.)
  2. Add possibility to open dialog window from services
  3. Add animation
  4. Add demo
  5. Add tests
  6. TBD

Troubleshooting

Problems? Check the Issues block to find the solution or create a new issue that we will fix asap. Feel free to contribute.

Author

This Angular module is open-sourced by Agilie Team [email protected]

Contributors

Maks Nechesonov

Contact us

If you have any questions, suggestions or just need a help with web or mobile development, please email us at [email protected]. You can ask us anything from basic to complex questions.

We will continue publishing new open-source projects. Stay with us, more updates will follow!

License

The MIT License (MIT) Copyright © 2017 Agilie Team