This repository is for demonstration purposes of how it can be implemented in Angular and is not maintaned. Please fork and maintain your own version of this repository.
ngx-modal8
Open 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.
Installation
-
Install npm module:
npm install ngx-modal8 --save
-
If you are using system.js you may want to add this into
map
andpackage
config:
Simple Modal
Import ModalModule
in your app. Then you can use modal
component:
Modal header content goes there. Modal body content goes there. Modal footer content goes there.
Router Modal
First, import ModalModule
in your app.
If you want your modals to be opened within routes,
then <route-modal></route-modal>
should be used instead.
Sample
;;
More samples
<!-- first modal: modal with custom header, content and footer --> modal with custom header content and footer I am first modal This modal has its own header, content and footer. okay! <!-- second modal: disable close button --> modal without close button I am second modal This modal does not have close button. okay! <!-- third modal: disable close button --> modal that cannot be simply closed I am third modal You cannot close this modal by pressing "ESC" button or clicking outside of the modal. okay! <!-- forth modal: this modal has default title and cancle button --> modal that has title and cancel button You can simply use "title" attribute to provide a modal default header. Also you can add default cancel button by providing a label to it. <!-- fifth modal: this modal uses extra "large class" --> large modal Very large modal. <!-- sixth modal: this modal uses extra "small class" --> small modal Very small modal. <!-- seventh modal: this modal can listen close event --> it opens first modal after you close it Now try to close it and it will open you first modal. <!-- eighth modal: this modal can listen open event --> it opens first modal right after you open it This modal opened first modal right after you opened it. <!-- ninth modal: this modal can do something after you click submit button --> it opens first modal after you click submit button This modal has a submit button with your custom label. Also it can make an action after you click that submit button. Here it will open you first modal after you click submit.
Take a look on samples in ./sample for more examples of usages.