@@ -12,8 +12,8 @@ const exampleTemplateModalTemplate = `
1212 <p>{{ context.data }}</p>
1313 </div>
1414 <div class="actions">
15- <button class="ui red button" (click)="modal.deny('denied! ')">Cancel</button>
16- <button class="ui green button" (click)="modal.approve('approved! ')">OK</button>
15+ <button class="ui red button" (click)="modal.deny('denied')">Cancel</button>
16+ <button class="ui green button" (click)="modal.approve('approved')">OK</button>
1717 </div>
1818</ng-template>
1919` ;
@@ -153,7 +153,7 @@ export class MyComponent {
153153public open(dynamicContent:string = "Example") {
154154 const config = new TemplateModalConfig<IContext, string, string>(this.modalTemplate);
155155
156- config.isClosable = false ;
156+ config.closeResult = "closed!" ;
157157 config.context = { data: dynamicContent };
158158
159159 this.modalService
@@ -195,8 +195,8 @@ export class ConfirmModal extends ComponentModalConfig<IConfirmModalContext, voi
195195 public componentOpen = `
196196this.modalService
197197 .open(new ConfirmModal("Are you sure?", "Are you sure about accepting this?"))
198- .onApprove(() => alert("accepted! "))
199- .onDeny(() => alert("denied! "));
198+ .onApprove(() => alert("User has accepted. "))
199+ .onDeny(() => alert("User has denied. "));
200200` ;
201201}
202202
@@ -215,13 +215,13 @@ export class ModalExampleTemplate {
215215 public open ( dynamicContent :string = "Example" ) {
216216 const config = new TemplateModalConfig < { data :string } , string , string > ( this . modalTemplate ) ;
217217
218- config . isClosable = false ;
218+ config . closeResult = "dismissed" ;
219219 config . context = { data : dynamicContent } ;
220220
221221 this . modalService
222222 . open ( config )
223- . onApprove ( r => alert ( r ) )
224- . onDeny ( r => alert ( r ) ) ;
223+ . onApprove ( r => alert ( `Accepted with result: ' ${ r } '.` ) )
224+ . onDeny ( r => alert ( `Denied with result: ' ${ r } '.` ) ) ;
225225 }
226226}
227227
@@ -258,8 +258,8 @@ export class ModalExampleComponent {
258258 public open ( ) {
259259 this . modalService
260260 . open ( new ConfirmModal ( "Are you sure?" , "Are you sure about accepting this?" ) )
261- . onApprove ( ( ) => alert ( "accepted! " ) )
262- . onDeny ( ( ) => alert ( "denied! " ) ) ;
261+ . onApprove ( ( ) => alert ( "User has accepted. " ) )
262+ . onDeny ( ( ) => alert ( "User has denied. " ) ) ;
263263 }
264264}
265265
0 commit comments