An open API service indexing awesome lists of open source software.

https://github.com/webfactorymk/ngx-wf-modal


https://github.com/webfactorymk/ngx-wf-modal

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

        

# ngx-wf-modal

A Modal Dialog Module that can receive dynamic content.
Compatible with bootstrap 3

# Install

1. Install npm module:

```bash
npm install ngx-wf-modal --save
```

2. If you are using system.js you may want to add this into `map` and `package` config:

```json
{
"map": {
"ngx-wf-modal": "node_modules/ngx-wf-modal"
},
"packages": {
"ngx-wf-modal": { "main": "index.js", "defaultExtension": "js" }
}
}
```

Add the module to your project

```typescript
@NgModule({
imports: [
NgxWfModalModule
]
...
)}
```

In the html file, you can insert the modal component

```html


{{title}}


{{message}}


OK

```

```typescript
@Input() hasCloseButton: boolean = true;
@Input() closeOnEscape: boolean = true;
@Input() closeOnOutsideClick: boolean = true;

@Input() modalSizeClass: string = "modal-lg";
@Input() modalClasses: string = "";

@Input() submitButtonText: string = "";
@Input() cancelButtonText: string = "";
```

# Inputs
### hasCloseButton: boolean (default: true)
Specifies if the top X button for closing the dialog should be shown

### closeOnEscape: boolean (default: true)
Specifies if the modal should be closed when escape is clicked

### closeOnOutsideClick: boolean (default: true)
Specifies if the modal should be closed on outside mouse clicks

### modalSizeClass: string (default: "modal-lg")
The class for the modal size (lg, md, sm)

### modalClasses: string (default: "")
Additional classes that should be added to the modal-dialog div tag

### submitButtonText: string (default: "")
The text for the submit button. If not specified, the submit button will not be shown

### cancelButtonText: string (default: "")
The text for the cancel button. If not specified, the cancel button will not be shown

# Outputs
```typescript
@Output() onModalOpened = new EventEmitter();
@Output() onModalClosed = new EventEmitter();

@Output() onModalSubmit = new EventEmitter();
@Output() onModalCancel = new EventEmitter();
```