A customizable modal for Angular 2
It uses the Bootstrap modal by default. You can also provide a custom modal view.
- Default bootstrap modal layout
- Customizable modal layout
- Alert dialog
- Customizable Alert component
- Confirmation dialog
- Customizable Confirmation component
- Dialog result callback
- Dialog dismiss callback
- Dismiss validation
- Good documentation
- 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
setModalLayout(type): - TODO
setAlertComponent(type): - TODO
setConfirmComponent(type): - TODO
setPlacement(container: ViewContainerRef): - TODO
openModal(componentType: any, title: string, contentParams?: any): ThenElse<any>