You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-91Lines changed: 37 additions & 91 deletions
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,8 @@ export class AppModule { }
52
52
```
53
53
2. Create a custom component that implements `IModalDialog` or use the `SimpleModalDialog` as a child component.
54
54
55
+
Custom component should be inserted into both `declarations` and `entryComponents` in the NgModule they are part of. `entryComponents` has to be used since component is dynamically inserted onto the page and Angular is not aware of it.
56
+
55
57
3. Inject the `ModalDialogService` where you want to open the dialog. Call `openDialog` passing parent `ViewContainerRef` and `IModalDialogOptions`:
This method is called after initialization of child component. Purpose of the method is to pass necessary information from outer scope to child component.
Component type that will be rendered as a content of modal dialog. Component must implement `IModalDialog` interface.
130
126
131
-
-`onClose()`
132
-
Mandatory: `false`
133
-
Default: -
134
-
Type: `function`
135
-
Input: -
136
-
ReturnType: `Promise<any>` or `Observable<any>` or `boolean`
127
+
- onClose(): `Promise<any>` or `Observable<any>` or `boolean`
137
128
Function to be called on close button click. In case of Promise and Observable, modal dialog will not close unless successful resolve happens. In case of boolean, modal dialog will close only if result is `truthful`.
138
129
139
-
-`actionButtons`
140
-
Mandatory: `false`
141
-
Default: -
142
-
Type: `Array<IModalDialogButton>`
130
+
- actionButtons: `Array<IModalDialogButton>`
143
131
Footer action buttons for control of modal dialog. See [IModalDialogButton](#imodaldialogbutton).
144
132
Action buttons defined in child component have priority over action buttons defined via options.
145
133
146
-
-`data`
147
-
Mandatory: `false`
148
-
Default: -
149
-
Type: -
134
+
- data: `any`
150
135
Arbitrary data that will be passed to child component via `dialogInit` method.
151
136
152
-
-`settings`
153
-
Mandatory: `false`
154
-
Default: -
155
-
Type: `IModalDialogSettings`
137
+
- settings: `IModalDialogSettings`
156
138
Additional settings for granular configuration of modal dialog. See [IModalDialogSettings](#imodaldialogsettings).
Function to be called on button click. In case of Promise and Observable, modal dialog will not close unless successful resolve happens. In case of boolean, modal dialog will close only if result is `truthful`.
0 commit comments