{"id":19162335,"url":"https://github.com/agilie/ng2-dialog-window","last_synced_at":"2025-05-07T10:41:30.192Z","repository":{"id":57095558,"uuid":"92955856","full_name":"agilie/ng2-dialog-window","owner":"agilie","description":"Modal/dialog windows and popups module for Angular applications.","archived":false,"fork":false,"pushed_at":"2017-07-12T19:24:33.000Z","size":21,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-04T06:03:05.374Z","etag":null,"topics":["angular","dialog-window","javascript","ng2","popup"],"latest_commit_sha":null,"homepage":"https://agilie.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agilie.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.MD","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-31T14:40:19.000Z","updated_at":"2022-10-28T14:15:50.000Z","dependencies_parsed_at":"2022-08-22T23:10:33.792Z","dependency_job_id":null,"html_url":"https://github.com/agilie/ng2-dialog-window","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilie%2Fng2-dialog-window","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilie%2Fng2-dialog-window/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilie%2Fng2-dialog-window/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilie%2Fng2-dialog-window/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agilie","download_url":"https://codeload.github.com/agilie/ng2-dialog-window/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252861792,"owners_count":21815752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","dialog-window","javascript","ng2","popup"],"created_at":"2024-11-09T09:10:21.421Z","updated_at":"2025-05-07T10:41:30.169Z","avatar_url":"https://github.com/agilie.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/agilie/ng2-dialog-window)\n\n# ng2-dialog-window\n\nDialog window module for Angular (Angular 2) applications which allows to open dialog window using custom components. Any data could be easily send to component.\n\n## Installation\n\nTo install this module, run:\n\n```bash\n$ npm install @agilie/ng2-dialog-window --save\n```\n\n## Usage\n\n```typescript\nimport { NgModule } from '@angular/core';\nimport { YourDialogWindowComponent } from './component/path'\nimport { AppComponent } from './app.component'\nimport { Ng2DialogWindowModule, Ng2DialogWindowService } from '@agilie/ng2-dialog-window';\n\n \n@NgModule({\n    imports: [\n        // ... \n        Ng2DialogWindowModule\n    ],\n    declarations: [\n        AppComponent,\n        // ....\n        YourDialogWindowComponent\n    ],\n    providers: [\n        //...\n        Ng2DialogWindowService\n    ],\n    //...\n    entryComponents: [\n        YourDialogWindowComponent\n    ],\n})\nexport class AppModule {\n \n}\n```\n\n```typescript\nimport { Component, ViewContainerRef } from '@angular/core';\nimport { Ng2DialogWindowService } from '@agilie/ng2-dialog-window';\nimport { YourDialogWindowComponent } from './component/path'\n\n \n@Component({\n  selector: 'app-component',\n  template: '\u003cbutton (click)=\"openModal()\"\u003eOpen modal\u003c/button\u003e'\n})\nexport class AppComponent {\n\n    constructor( private dialog: Ng2DialogWindowService, private viewContainer: ViewContainerRef) {\n        \n    }\n    \n    openModal() {\n        this.dialog.openModal(this.viewContainer, {component: YourDialogWindowComponent})\n    }\n\n}\n```\nYou 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.\n\n*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.*\n\n```typescript\nimport { Component } from '@angular/core';\nimport { Ng2DialogWindowComponent } from '@agilie/ng2-dialog-window'\n\n@Component({\n  selector: 'my-dialog-window',\n  template: '\u003cng2-dialog-window-component\u003e\u003c!-- Body of dialog window --\u003e\u003c/ng2-dialog-window-component\u003e'\n})\nexport class YourDialogWindowComponent extends Ng2DialogWindowComponent {\n\n}\n\n```\n## API\n\nHere is the list of accessible methods that you can use:\n\n#### ```Ng2DialogWindowService```\n\n```.openModal(viewContainerRef, options)```\n\nMethod allows to open dialog window. It creates new dialog instance on each call. It accepts viewContainerRef of component and options object as arguments.\n\n```viewContainerRef {viewContainerRef}``` - viewContainerRef of component from which you call ```openModal``` method\n\n##### ```options```\n\n```component {Component}``` - dialog window component\n\n```data {String} | {Object} | {Array}``` - any serializable data that you want to be stored in dialog component and be available from ```dialogData```.\n\n#### Dialog component\n\n```close()``` - extended method from base dialog component. Closes dialog window.\n\n## TODOs\n\n1. Add more options (closeByClick, showCloseButton etc.)\n2. Add possibility to open dialog window from services\n3. Add animation\n4. Add demo\n5. Add tests\n6. TBD\n\n## Troubleshooting\nProblems? Check the [Issues](https://github.com/agilie/ng2-dialog-window/issues) block \nto find the solution or create a new issue that we will fix asap. Feel free to contribute.\n\n## Author\nThis Angular module is open-sourced by [Agilie Team](https://www.agilie.com) \u003cinfo@agilie.com\u003e\n\n## Contributors\n\n[Maks Nechesonov](https://github.com/NechiK)\n\n## Contact us\nIf you have any questions, suggestions or just need a help with web or mobile development, please email us at \u003cweb@agilie.com\u003e. You can ask us anything from basic to complex questions. \n\nWe will continue publishing new open-source projects. Stay with us, more updates will follow!\n\n## License\nThe [MIT](LICENSE.MD) License (MIT) Copyright © 2017 [Agilie Team](https://www.agilie.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilie%2Fng2-dialog-window","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagilie%2Fng2-dialog-window","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilie%2Fng2-dialog-window/lists"}