{"id":13497204,"url":"https://github.com/pleerock/ngx-modal","last_synced_at":"2025-03-28T21:32:07.511Z","repository":{"id":65411333,"uuid":"52957528","full_name":"pleerock/ngx-modal","owner":"pleerock","description":"Open modal window (dialog box) for your angular2 applications using bootstrap3.","archived":true,"fork":false,"pushed_at":"2017-06-03T23:41:03.000Z","size":52,"stargazers_count":108,"open_issues_count":28,"forks_count":80,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-22T16:46:57.192Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"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/pleerock.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":"2016-03-02T11:24:04.000Z","updated_at":"2025-01-31T21:02:28.000Z","dependencies_parsed_at":"2023-01-22T06:55:15.646Z","dependency_job_id":null,"html_url":"https://github.com/pleerock/ngx-modal","commit_stats":null,"previous_names":["pleerock/ng2-modal"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleerock%2Fngx-modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleerock%2Fngx-modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleerock%2Fngx-modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleerock%2Fngx-modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pleerock","download_url":"https://codeload.github.com/pleerock/ngx-modal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246105326,"owners_count":20724294,"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-07-31T20:00:26.535Z","updated_at":"2025-03-28T21:32:07.193Z","avatar_url":"https://github.com/pleerock.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized","Awesome Angular [![Awesome TipeIO](https://img.shields.io/badge/Awesome%20Angular-@TipeIO-6C6AE7.svg)](https://github.com/gdi2290/awesome-angular) [![Awesome devarchy.com](https://img.shields.io/badge/Awesome%20Angular-@devarchy.com-86BDC1.svg)](https://github.com/brillout/awesome-angular-components)"],"sub_categories":["Uncategorized","Angular \u003ca id=\"angular\"\u003e\u003c/a\u003e"],"readme":"\u003e This repository is for demonstration purposes of how it can be implemented in Angular and is not maintaned.\r\nPlease fork and maintain your own version of this repository.\r\n\r\n\r\n# 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## Installation\r\n\r\n1. Install npm module:\r\n    \r\n    `npm install ngx-modal --save`\r\n\r\n2. If you are using system.js you may want to add this into `map` and `package` config:\r\n\r\n    ```json\r\n    {\r\n        \"map\": {\r\n            \"ngx-modal\": \"node_modules/ngx-modal\"\r\n        },\r\n        \"packages\": {\r\n            \"ngx-modal\": { \"main\": \"index.js\", \"defaultExtension\": \"js\" }\r\n        }\r\n    }\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 \"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/pleerock/ngx-modal/tree/master/sample) for more examples of\r\nusages.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpleerock%2Fngx-modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpleerock%2Fngx-modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpleerock%2Fngx-modal/lists"}