{"id":18664474,"url":"https://github.com/herbis/ngx-modal","last_synced_at":"2025-04-11T21:32:50.645Z","repository":{"id":45380387,"uuid":"89471816","full_name":"Herbis/ngx-modal","owner":"Herbis","description":"Open modal window (dialog box) for your angular2 applications using bootstrap3.","archived":false,"fork":false,"pushed_at":"2021-12-16T17:09:55.000Z","size":196,"stargazers_count":6,"open_issues_count":3,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-03T14:41:02.418Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Herbis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-26T11:09:24.000Z","updated_at":"2023-05-25T05:25:24.000Z","dependencies_parsed_at":"2022-09-19T08:20:21.663Z","dependency_job_id":null,"html_url":"https://github.com/Herbis/ngx-modal","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Herbis%2Fngx-modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Herbis%2Fngx-modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Herbis%2Fngx-modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Herbis%2Fngx-modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Herbis","download_url":"https://codeload.github.com/Herbis/ngx-modal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223481400,"owners_count":17152269,"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":[],"created_at":"2024-11-07T08:23:42.218Z","updated_at":"2024-11-07T08:23:42.807Z","avatar_url":"https://github.com/Herbis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This fork of [ngx-modal](https://github.com/pleerock/ngx-modal) accepts PRs but is no longer actively maintained. \r\n___\r\n# ngx-modal\r\n\r\n[![Build Status](https://travis-ci.org/Herbis/ngx-modal.svg?branch=master)](https://travis-ci.org/Herbis/ngx-modal)\r\n[![npm version](https://img.shields.io/npm/v/@herbis/ngx-modal.svg)](https://www.npmjs.com/package/@herbis/ngx-modal)\r\n\r\nOpen modal window (dialog box) for your angular2 applications using bootstrap3. If you don't want to use it without bootstrap - simply create proper css classes. Please star a project if you liked it, or create an issue if you have problems with it.\r\n\r\n\r\n| Version | Angular Version |\r\n|---------|----------------|\r\n| 9.0.0   |         9+     |\r\n| 8.0.1   |         8+     |\r\n| 0.1.0   |         2+     |\r\nVersion 9.0.0 moves from CommonJs to ES. \r\n\r\n## Installation\r\n\r\n1. Install npm module:\r\n    \r\n    `npm install @herbis/ngx-modal --save`\r\n\r\n\r\n## Simple Modal\r\n\r\nImport `ModalModule` in your app. Then you can use `modal` component:\r\n\r\n```html\r\n\u003cmodal  title=\"Modal title\"\r\n        cancelButtonLabel=\"cancel\"\r\n        submitButtonLabel=\"submit\"\r\n        modalClass=\"modal-lg modal-sm any-other-css-class\"\r\n        [hideCloseButton]=\"true|false\"\r\n        [closeOnEscape]=\"true|false\"\r\n        [closeOnOutsideClick]=\"true|false\"\r\n        (onOpen)=\"actionOnOpen()\"\r\n        (onClose)=\"actionOnClose()\"\r\n        (onSubmit)=\"actionOnSubmit()\"\u003e\r\n\r\n    \u003cmodal-header\u003e\r\n        Modal header content goes there.\r\n    \u003c/modal-header\u003e\r\n\r\n    \u003cmodal-content\u003e\r\n        Modal body content goes there.\r\n    \u003c/modal-content\u003e\r\n\r\n    \u003cmodal-footer\u003e\r\n        Modal footer content goes there.\r\n    \u003c/modal-footer\u003e\r\n        \r\n\u003c/modal\u003e\r\n```\r\n\r\n## Router Modal\r\n\r\nFirst, import `ModalModule` in your app.\r\nIf you want your modals to be opened within routes,\r\nthen `\u003croute-modal\u003e\u003c/route-modal\u003e` should be used instead.\r\n\r\n## Sample\r\n\r\n```typescript\r\nimport {Component} from \"@angular/core\";\r\nimport {ModalModule} from \"@herbis/ngx-modal\";\r\n\r\n@Component({\r\n    selector: \"app\",\r\n    template: `\r\n\u003cdiv class=\"row\"\u003e\r\n    \u003cbutton (click)=\"myModal.open()\"\u003eopen my modal\u003c/button\u003e\r\n    \u003cmodal #myModal\u003e\r\n        \u003cmodal-header\u003e\r\n            \u003ch1\u003eModal header\u003c/h1\u003e\r\n        \u003c/modal-header\u003e\r\n        \u003cmodal-content\u003e\r\n            Hello Modal!\r\n        \u003c/modal-content\u003e\r\n        \u003cmodal-footer\u003e\r\n            \u003cbutton class=\"btn btn-primary\" (click)=\"myModal.close()\"\u003eclose\u003c/button\u003e\r\n        \u003c/modal-footer\u003e\r\n    \u003c/modal\u003e\r\n\u003c/div\u003e\r\n    `\r\n})\r\nexport class App {\r\n\r\n}\r\n\r\n@NgModule({\r\n    imports: [\r\n        // ...\r\n        ModalModule\r\n    ],\r\n    declarations: [\r\n        App\r\n    ],\r\n    bootstrap: [\r\n        App\r\n    ]\r\n})\r\nexport class AppModule {\r\n\r\n}\r\n```\r\n\r\n## More samples\r\n\r\n```html\r\n\u003c!-- first modal: modal with custom header, content and footer --\u003e\r\n\u003cdiv class=\"row\"\u003e\r\n    \u003cbutton (click)=\"firstModal.open()\"\u003emodal with custom header content and footer\u003c/button\u003e\r\n    \u003cmodal #firstModal\u003e\r\n        \u003cmodal-header\u003e\r\n            \u003ch1\u003eI am first modal\u003c/h1\u003e\r\n        \u003c/modal-header\u003e\r\n        \u003cmodal-content\u003e\r\n            This modal has its own header, content and footer.\r\n        \u003c/modal-content\u003e\r\n        \u003cmodal-footer\u003e\r\n            \u003cbutton class=\"btn btn-primary\" (click)=\"firstModal.close()\"\u003eokay!\u003c/button\u003e\r\n        \u003c/modal-footer\u003e\r\n    \u003c/modal\u003e\r\n\u003c/div\u003e\r\n\r\n\u003c!-- second modal: disable close button --\u003e\r\n\u003cdiv class=\"row\"\u003e\r\n    \u003cbutton (click)=\"secondModal.open()\"\u003emodal without close button\u003c/button\u003e\r\n    \u003cmodal #secondModal [hideCloseButton]=\"true\"\u003e\r\n        \u003cmodal-header\u003e\r\n            \u003ch1\u003eI am second modal\u003c/h1\u003e\r\n        \u003c/modal-header\u003e\r\n        \u003cmodal-content\u003e\r\n            This modal does not have close button.\r\n        \u003c/modal-content\u003e\r\n        \u003cmodal-footer\u003e\r\n            \u003cbutton class=\"btn btn-primary\" (click)=\"secondModal.close()\"\u003eokay!\u003c/button\u003e\r\n        \u003c/modal-footer\u003e\r\n    \u003c/modal\u003e\r\n\u003c/div\u003e\r\n\r\n\u003c!-- third modal: disable close button --\u003e\r\n\u003cdiv class=\"row\"\u003e\r\n    \u003cbutton (click)=\"thirdModal.open()\"\u003emodal that cannot be simply closed\u003c/button\u003e\r\n    \u003cmodal #thirdModal [closeOnEscape]=\"false\" [closeOnOutsideClick]=\"false\"\u003e\r\n        \u003cmodal-header\u003e\r\n            \u003ch1\u003eI am third modal\u003c/h1\u003e\r\n        \u003c/modal-header\u003e\r\n        \u003cmodal-content\u003e\r\n            You cannot close this modal by pressing \"ESC\" button or clicking outside of the modal.\r\n        \u003c/modal-content\u003e\r\n        \u003cmodal-footer\u003e\r\n            \u003cbutton class=\"btn btn-primary\" (click)=\"thirdModal.close()\"\u003eokay!\u003c/button\u003e\r\n        \u003c/modal-footer\u003e\r\n    \u003c/modal\u003e\r\n\u003c/div\u003e\r\n\r\n\u003c!-- forth modal: this modal has default title and cancle button --\u003e\r\n\u003cdiv class=\"row\"\u003e\r\n    \u003cbutton (click)=\"forthModal.open()\"\u003emodal that has title and cancel button\u003c/button\u003e\r\n    \u003cmodal #forthModal title=\"I am forth modal\" cancelButtonLabel=\"close it\"\u003e\r\n        \u003cmodal-content\u003e\r\n            You can simply use \"title\" attribute to provide a modal default header.\u003cbr/\u003e\r\n            Also you can add default cancel button by providing a label to it.\r\n        \u003c/modal-content\u003e\r\n    \u003c/modal\u003e\r\n\u003c/div\u003e\r\n\r\n\u003c!-- fifth modal: this modal uses extra \"large class\" --\u003e\r\n\u003cdiv class=\"row\"\u003e\r\n    \u003cbutton (click)=\"fifthModal.open()\"\u003elarge modal\u003c/button\u003e\r\n    \u003cmodal #fifthModal title=\"I am fifth modal\" cancelButtonLabel=\"close it\" modalClass=\"modal-lg\"\u003e\r\n        \u003cmodal-content\u003e\r\n            Very large modal.\r\n        \u003c/modal-content\u003e\r\n    \u003c/modal\u003e\r\n\u003c/div\u003e\r\n\r\n\u003c!-- sixth modal: this modal uses extra \"small class\" --\u003e\r\n\u003cdiv class=\"row\"\u003e\r\n    \u003cbutton (click)=\"sixthModal.open()\"\u003esmall modal\u003c/button\u003e\r\n    \u003cmodal #sixthModal title=\"I am sixth modal\" cancelButtonLabel=\"close it\" modalClass=\"modal-sm\"\u003e\r\n        \u003cmodal-content\u003e\r\n            Very small modal.\r\n        \u003c/modal-content\u003e\r\n    \u003c/modal\u003e\r\n\u003c/div\u003e\r\n\r\n\u003c!-- seventh modal: this modal can listen close event --\u003e\r\n\u003cdiv class=\"row\"\u003e\r\n    \u003cbutton (click)=\"seventhModal.open()\"\u003eit opens first modal after you close it\u003c/button\u003e\r\n    \u003cmodal #seventhModal title=\"I am seventh modal\" cancelButtonLabel=\"close it\" (onClose)=\"firstModal.open()\"\u003e\r\n        \u003cmodal-content\u003e\r\n            Now try to close it and it will open you first modal.\r\n        \u003c/modal-content\u003e\r\n    \u003c/modal\u003e\r\n\u003c/div\u003e\r\n\r\n\u003c!-- eighth modal: this modal can listen open event --\u003e\r\n\u003cdiv class=\"row\"\u003e\r\n    \u003cbutton (click)=\"eighthModal.open()\"\u003eit opens first modal right after you open it\u003c/button\u003e\r\n    \u003cmodal #eighthModal title=\"I am eighth modal\" cancelButtonLabel=\"close it\" (onOpen)=\"firstModal.open()\"\u003e\r\n        \u003cmodal-content\u003e\r\n            This modal opened first modal right after you opened it.\r\n        \u003c/modal-content\u003e\r\n    \u003c/modal\u003e\r\n\u003c/div\u003e\r\n\r\n\u003c!-- ninth modal: this modal can do something after you click submit button --\u003e\r\n\u003cdiv class=\"row\"\u003e\r\n    \u003cbutton (click)=\"ninthModal.open()\"\u003eit opens first modal after you click submit button\u003c/button\u003e\r\n    \u003cmodal #ninthModal title=\"I am ninth modal\" submitButtonLabel=\"submit\" (onSubmit)=\"firstModal.open()\"\u003e\r\n        \u003cmodal-content\u003e\r\n            This modal has a submit button with your custom label. Also it can make an action after you\r\n            click that submit button. Here it will open you first modal after you click submit.\r\n        \u003c/modal-content\u003e\r\n    \u003c/modal\u003e\r\n\u003c/div\u003e\r\n```\r\n\r\nTake a look on samples in [./sample](https://github.com/Herbis/ngx-modal/tree/master/sample) for more examples of\r\nusages.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fherbis%2Fngx-modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fherbis%2Fngx-modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fherbis%2Fngx-modal/lists"}