diff --git a/packages/mosaic-dev/modal/module.ts b/packages/mosaic-dev/modal/module.ts
index 34d080751..699651745 100644
--- a/packages/mosaic-dev/modal/module.ts
+++ b/packages/mosaic-dev/modal/module.ts
@@ -57,6 +57,12 @@ export class ModalDemoComponent {
});
}
+ createModalComponent() {
+ const modalRef = this.modalService.open({
+ mcComponent: McModalFullCustomComponent
+ });
+ }
+
createLongModal() {
const modal = this.modalService.create({
@@ -163,15 +169,50 @@ export class McModalCustomComponent {
}
}
+@Component({
+ selector: 'mc-modal-full-custom-component',
+ template: `
+
+ Get Modal instance in component
+
+ {{ title }}
+ {{ subtitle }}
+
Modal with looong component
+ diff --git a/packages/mosaic/modal/README.md b/packages/mosaic/modal/README.md index e69de29bb..ab06b9944 100644 --- a/packages/mosaic/modal/README.md +++ b/packages/mosaic/modal/README.md @@ -0,0 +1,34 @@ +The dialog is currently divided into 3 modes - `default`, `confirm box`, `custom`. + + +#### Using service to create Confirm Mode + +```ts +showConfirm() { + this.modalService.success({ + mcContent : 'Save changes made to the request "All assets with Windows"?', + mcOkText : 'Save', + mcCancelText: 'Cancel', + mcOnOk : () => console.log('OK') + }); +} +``` + +#### Using service to open modal Custom Mode + +```ts +let dialogRef = modalService.open({ + mcComponent: CustomComponent +}); +``` + +```ts +@Component({/* ... */}) +export class CustomComponent { + constructor(private dialogRef: McModalRef) { } + + closeDialog() { + this.modal.destroy({ data: 'this the result data' }); + } +} +``` \ No newline at end of file diff --git a/packages/mosaic/modal/modal.component.html b/packages/mosaic/modal/modal.component.html index 957f2101e..8eda1ff7c 100644 --- a/packages/mosaic/modal/modal.component.html +++ b/packages/mosaic/modal/modal.component.html @@ -38,12 +38,19 @@ [ngTemplateOutlet]="tplContentDefault">