Smart Dialog Service
The Smart Dialog Service provides an easy way to display Smart Dialogs.
Displaying a Smart Dialog
For a list of all configuration options available for the Smart Dialog, please see the API reference.
import { SmartDialogService, DialogButtons } from '@consultingwerk/smartcomponents-core';
constructor(private dialogService: SmartDialogService) { }
ngOnInit() {
this.dialogService.showDialog({
template: '<h1>Hello World</h1>'
buttons: [DialogButtons.OK, DialogButtons.create('Custom Button') /** includes a button with custom text */]
})
.then((button: DialogButtons) => {
if (button === DialogButtons.OK) {
//user clicked the ok button
}
});
}Note
For the Smart Dialog Service to be able to display dialogs, a Smart Dialog Outlet must be included in your root component.