ng2-openmodal
A customizable modal for Angular 2
It uses the Bootstrap modal by default. You can also provide a custom modal view.
Features List
- [x] Default bootstrap modal layout
- [x] Customizable modal layout
- [x] Alert dialog
- [x] Customizable Alert component
- [x] Confirmation dialog
- [x] Customizable Confirmation component
- [x] Dialog result callback
- [x] Dialog dismiss callback
- [x] Dismiss validation
- [ ] Good documentation
Basic Usage
- Install the package
ng2-openmodal
npm install --save ng2-openmodal
- Add entries in the file
systemjs.config.js
...
var map = {
...
// Here it goes!
'ng2-openmodal': 'node_modules/ng2-openmodal',
...
};
var packages = {
...
'ng2-openmodal': { main: 'index.js', defaultExtension: 'js' },
...
};
- Set the modal placement, e.g.
import { ModalService } from 'ng2-openmodal';
...
@ViewChild('modalPlacement', {read: ViewContainerRef}) modalPlacement: ViewContainerRef;
...
this.modalService.setPlacement(this.modalPlacement);
-
TODO Invoke
ModalService.openModal
- Enjoy it!
TODO Modal response
ThenElse
class
TODO The TODO Additional features
ModalService
methods
-
TODO
setModalLayout(type)
: -
TODO
setAlertComponent(type)
: -
TODO
setConfirmComponent(type)
: -
TODO
setPlacement(container: ViewContainerRef)
: -
TODO
openModal(componentType: any, title: string, contentParams?: any): ThenElse<any>