Gathering detailed insights and metrics for ngx-modal
Gathering detailed insights and metrics for ngx-modal
Gathering detailed insights and metrics for ngx-modal
Gathering detailed insights and metrics for ngx-modal
ngx-smart-modal
Smart modal handler to manage modals and data everywhere in Angular apps.
ngx-simple-modal
A simple unopinionated framework to implement simple modal based behaviour in angular (v2+) projects.
ngx-bootstrap-modal
simplify the work with bootstrap modal dialogs
ngx-url-modal
Simple Angular library for keeping modal state in URL query params
Open modal window (dialog box) for your angular2 applications using bootstrap3.
npm install ngx-modal
Typescript
Module System
Node Version
NPM Version
TypeScript (99.51%)
JavaScript (0.49%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
108 Stars
65 Commits
80 Forks
9 Watchers
2 Branches
8 Contributors
Updated on Jan 31, 2025
Latest Version
0.0.29
Package Id
ngx-modal@0.0.29
Size
14.61 kB
NPM Version
3.10.3
Node Version
6.6.0
Published on
Jan 20, 2017
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
33
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.
Install npm module:
npm install ngx-modal --save
If you are using system.js you may want to add this into map
and package
config:
1{ 2 "map": { 3 "ngx-modal": "node_modules/ngx-modal" 4 }, 5 "packages": { 6 "ngx-modal": { "main": "index.js", "defaultExtension": "js" } 7 } 8}
Import ModalModule
in your app. Then you can use modal
component:
1<modal title="Modal title" 2 cancelButtonLabel="cancel" 3 submitButtonLabel="submit" 4 modalClass="modal-lg modal-sm any-other-css-class" 5 [hideCloseButton]="true|false" 6 [closeOnEscape]="true|false" 7 [closeOnOutsideClick]="true|false" 8 (onOpen)="actionOnOpen()" 9 (onClose)="actionOnClose()" 10 (onSubmit)="actionOnSubmit()"> 11 12 <modal-header> 13 Modal header content goes there. 14 </modal-header> 15 16 <modal-content> 17 Modal body content goes there. 18 </modal-content> 19 20 <modal-footer> 21 Modal footer content goes there. 22 </modal-footer> 23 24</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.
1import {Component} from "@angular/core"; 2import {ModalModule} from "ngx-modal"; 3 4@Component({ 5 selector: "app", 6 template: ` 7<div class="row"> 8 <button (click)="myModal.open()">open my modal</button> 9 <modal #myModal> 10 <modal-header> 11 <h1>Modal header</h1> 12 </modal-header> 13 <modal-content> 14 Hello Modal! 15 </modal-content> 16 <modal-footer> 17 <button class="btn btn-primary" (click)="myModal.close()">close</button> 18 </modal-footer> 19 </modal> 20</div> 21 ` 22}) 23export class App { 24 25} 26 27@NgModule({ 28 imports: [ 29 // ... 30 ModalModule 31 ], 32 declarations: [ 33 App 34 ], 35 bootstrap: [ 36 App 37 ] 38}) 39export class AppModule { 40 41}
1<!-- first modal: modal with custom header, content and footer --> 2<div class="row"> 3 <button (click)="firstModal.open()">modal with custom header content and footer</button> 4 <modal #firstModal> 5 <modal-header> 6 <h1>I am first modal</h1> 7 </modal-header> 8 <modal-content> 9 This modal has its own header, content and footer. 10 </modal-content> 11 <modal-footer> 12 <button class="btn btn-primary" (click)="firstModal.close()">okay!</button> 13 </modal-footer> 14 </modal> 15</div> 16 17<!-- second modal: disable close button --> 18<div class="row"> 19 <button (click)="secondModal.open()">modal without close button</button> 20 <modal #secondModal [hideCloseButton]="true"> 21 <modal-header> 22 <h1>I am second modal</h1> 23 </modal-header> 24 <modal-content> 25 This modal does not have close button. 26 </modal-content> 27 <modal-footer> 28 <button class="btn btn-primary" (click)="secondModal.close()">okay!</button> 29 </modal-footer> 30 </modal> 31</div> 32 33<!-- third modal: disable close button --> 34<div class="row"> 35 <button (click)="thirdModal.open()">modal that cannot be simply closed</button> 36 <modal #thirdModal [closeOnEscape]="false" [closeOnOutsideClick]="false"> 37 <modal-header> 38 <h1>I am third modal</h1> 39 </modal-header> 40 <modal-content> 41 You cannot close this modal by pressing "ESC" button or clicking outside of the modal. 42 </modal-content> 43 <modal-footer> 44 <button class="btn btn-primary" (click)="thirdModal.close()">okay!</button> 45 </modal-footer> 46 </modal> 47</div> 48 49<!-- forth modal: this modal has default title and cancle button --> 50<div class="row"> 51 <button (click)="forthModal.open()">modal that has title and cancel button</button> 52 <modal #forthModal title="I am forth modal" cancelButtonLabel="close it"> 53 <modal-content> 54 You can simply use "title" attribute to provide a modal default header.<br/> 55 Also you can add default cancel button by providing a label to it. 56 </modal-content> 57 </modal> 58</div> 59 60<!-- fifth modal: this modal uses extra "large class" --> 61<div class="row"> 62 <button (click)="fifthModal.open()">large modal</button> 63 <modal #fifthModal title="I am fifth modal" cancelButtonLabel="close it" modalClass="modal-lg"> 64 <modal-content> 65 Very large modal. 66 </modal-content> 67 </modal> 68</div> 69 70<!-- sixth modal: this modal uses extra "small class" --> 71<div class="row"> 72 <button (click)="sixthModal.open()">small modal</button> 73 <modal #sixthModal title="I am sixth modal" cancelButtonLabel="close it" modalClass="modal-sm"> 74 <modal-content> 75 Very small modal. 76 </modal-content> 77 </modal> 78</div> 79 80<!-- seventh modal: this modal can listen close event --> 81<div class="row"> 82 <button (click)="seventhModal.open()">it opens first modal after you close it</button> 83 <modal #seventhModal title="I am seventh modal" cancelButtonLabel="close it" (onClose)="firstModal.open()"> 84 <modal-content> 85 Now try to close it and it will open you first modal. 86 </modal-content> 87 </modal> 88</div> 89 90<!-- eighth modal: this modal can listen close event --> 91<div class="row"> 92 <button (click)="eighthModal.open()">it opens first modal right after you open it</button> 93 <modal #eighthModal title="I am eighth modal" cancelButtonLabel="close it" (onOpen)="firstModal.open()"> 94 <modal-content> 95 This modal opened first modal right after you opened it. 96 </modal-content> 97 </modal> 98</div> 99 100<!-- ninth modal: this modal can do something after you click submit button --> 101<div class="row"> 102 <button (click)="ninthModal.open()">it opens first modal after you click submit button</button> 103 <modal #ninthModal title="I am ninth modal" submitButtonLabel="submit" (onSubmit)="firstModal.open()"> 104 <modal-content> 105 This modal has a submit button with your custom label. Also it can make an action after you 106 click that submit button. Here it will open you first modal after you click submit. 107 </modal-content> 108 </modal> 109</div>
Take a look on samples in ./sample for more examples of usages.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 6/17 approved changesets -- score normalized to 3
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More